Add per-email sender name for compliance page emails
When an email has a sender name set (the organization name), the mailer composes the From header as "OrgName via Probo" instead of the default global sender name. This gives compliance page recipients clearer context about which organization is contacting them. Signed-off-by: Bryan Frimin <bryan@getprobo.com>
This commit is contained in:
@@ -202,9 +202,14 @@ func (w *SendingWorker) sendAndCommit(
|
||||
return fmt.Errorf("cannot load email attachments: %w", err)
|
||||
}
|
||||
|
||||
fromName := w.senderName
|
||||
if email.SenderName != nil {
|
||||
fromName = *email.SenderName + " via " + w.senderName
|
||||
}
|
||||
|
||||
mail := enmime.Builder().
|
||||
Subject(email.Subject).
|
||||
From(w.senderName, w.senderEmail).
|
||||
From(fromName, w.senderEmail).
|
||||
To(email.RecipientName, email.RecipientEmail).
|
||||
Text([]byte(email.TextBody))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user