git-multimail
git-multimail copied to clipboard
Individual email per recepient
Hello!
At the moment all email addresses listed in multimailhook.mailingList are collected in "To: " header. Is there a way to split it and send one email to each recepient for they not to see all the other recepients in "To: " field?
If there is no built-in way could you please suggest a place in the code where it can be done?
Alexander
If you are satisfied to use Bcc:
instead of To:
(in which case recipients will not see other recipients or themselves, this is pretty easy, though it depends on which mailer you are using:
- For
SendMailer
the list of recipients is taken from the text of the email. So if you changeTo:
toBcc:
inREFCHANGE_HEADER_TEMPLATE
andREVISION_HEADER_TEMPLATE
, then recipients will not see each other. - For
SMTPMailer
you can just delete theTo:
lines from those templates entirely. It should also suffice to convert theTo:
lines intoBcc:
lines, as I believe the SMTP server should strip out theBcc:
lines for you, but please double-check before you rely on this information.
If you insist on individualized emails (i.e., each recipient gets an email listing only that recipient in the To:
field) then some code has to be changed. I think the way to do it would be to remove the To:
lines from the HEADER_TEMPLATE
s and change the SendMailer.send()
and/or SMTPMailer.send()
methods to generate one email per recipient, each time prepending a To:
line for that particular recipient.
A funny idea would be to allow individual emails per recipient, with different options (e.g. this guy wants html, but this one prefers text).