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:
@@ -708,6 +708,7 @@ func (s *Service) CreateUpdateEmails(
|
||||
textBody,
|
||||
htmlBody,
|
||||
&coredata.EmailOptions{
|
||||
SenderName: new(orgName),
|
||||
ReplyTo: replyTo,
|
||||
UnsubscribeURL: &unsubscribeURL,
|
||||
MailingListUpdateID: &mailingListUpdateID,
|
||||
@@ -752,7 +753,18 @@ func (s *Service) buildConfirmationMail(
|
||||
return nil, fmt.Errorf("cannot render subscription confirmation email: %w", err)
|
||||
}
|
||||
|
||||
return coredata.NewEmail(fullName, email, subject, textBody, htmlBody, &coredata.EmailOptions{ReplyTo: replyTo, UnsubscribeURL: &unsubscribeURL}), nil
|
||||
return coredata.NewEmail(
|
||||
fullName,
|
||||
email,
|
||||
subject,
|
||||
textBody,
|
||||
htmlBody,
|
||||
&coredata.EmailOptions{
|
||||
SenderName: new(orgName),
|
||||
ReplyTo: replyTo,
|
||||
UnsubscribeURL: &unsubscribeURL,
|
||||
},
|
||||
), nil
|
||||
}
|
||||
|
||||
func (s *Service) buildUnsubscriptionMail(
|
||||
@@ -772,7 +784,17 @@ func (s *Service) buildUnsubscriptionMail(
|
||||
return nil, fmt.Errorf("cannot render unsubscription email: %w", err)
|
||||
}
|
||||
|
||||
return coredata.NewEmail(fullName, email, subject, textBody, htmlBody, &coredata.EmailOptions{ReplyTo: replyTo}), nil
|
||||
return coredata.NewEmail(
|
||||
fullName,
|
||||
email,
|
||||
subject,
|
||||
textBody,
|
||||
htmlBody,
|
||||
&coredata.EmailOptions{
|
||||
SenderName: new(orgName),
|
||||
ReplyTo: replyTo,
|
||||
},
|
||||
), nil
|
||||
}
|
||||
|
||||
func (s *Service) buildUnsubscribeURL(mailingListID gid.GID, email mail.Addr) (string, error) {
|
||||
|
||||
Reference in New Issue
Block a user