Skip to content

BillionMail gives you open-source MailServer, NewsLetter, Email Marketing — fully self-hosted, dev-friendly, and free from monthly fees. Join the discord: https://discord.gg/asfXzBUhZr

Adjust the value of the custom property

lotk841e7a84f929
diff --git a/core/internal/service/batch_mail/template_render.go b/core/internal/service/batch_mail/template_render.go
index 94ce4ccc..3ab2a507 100644
--- a/core/internal/service/batch_mail/template_render.go
+++ b/core/internal/service/batch_mail/template_render.go
@@ -61,19 +61,18 @@ func (e *TemplateEngine) RenderEmailTemplate(ctx context.Context, content string
).Replace(content)
// prepare subscriber data
- subscriberData := g.Map{
- "Email": "",
- "Active": 0,
- "Status": 0,
- "Attribs": g.Map{},
- }
+ subscriberData := make(map[string]interface{})
if contact != nil {
+ // Custom properties are added directly to subscriberData
+ if contact.Attribs != nil {
+ for k, v := range contact.Attribs {
+ subscriberData[k] = v
+ }
+ }
subscriberData["Email"] = contact.Email
subscriberData["Active"] = contact.Active
subscriberData["Status"] = contact.Status
- if contact.Attribs != nil {
- subscriberData["Attribs"] = contact.Attribs
- }
+
}
// prepare task data