Send mailing list emails
Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
This commit is contained in:
@@ -208,10 +208,20 @@ func (w *SendingWorker) sendAndCommit(
|
||||
To(email.RecipientName, email.RecipientEmail).
|
||||
Text([]byte(email.TextBody))
|
||||
|
||||
if email.ReplyTo != nil {
|
||||
mail = mail.ReplyTo("", email.ReplyTo.String())
|
||||
}
|
||||
|
||||
if email.HtmlBody != nil {
|
||||
mail = mail.HTML([]byte(*email.HtmlBody))
|
||||
}
|
||||
|
||||
if email.UnsubscribeURL != nil {
|
||||
mail = mail.
|
||||
Header("List-Unsubscribe", "<"+*email.UnsubscribeURL+">").
|
||||
Header("List-Unsubscribe-Post", "List-Unsubscribe=One-Click")
|
||||
}
|
||||
|
||||
for _, att := range attachments {
|
||||
var file coredata.File
|
||||
if err := file.LoadByID(ctx, conn, coredata.NewNoScope(), att.FileID); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user