git-multimail icon indicating copy to clipboard operation
git-multimail copied to clipboard

Individual email per recepient

Open evilchewits opened this issue 10 years ago • 2 comments

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

evilchewits avatar Jun 28 '14 14:06 evilchewits

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 change To: to Bcc: in REFCHANGE_HEADER_TEMPLATE and REVISION_HEADER_TEMPLATE, then recipients will not see each other.
  • For SMTPMailer you can just delete the To: lines from those templates entirely. It should also suffice to convert the To: lines into Bcc: lines, as I believe the SMTP server should strip out the Bcc: 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_TEMPLATEs 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.

mhagger avatar Aug 29 '14 07:08 mhagger

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).

moy avatar Sep 04 '15 17:09 moy