Anders Östman
Anders Östman

Reputation: 3832

Mandrill personalized message to recipients with same email

In a NodeJs app I'm using Mandrill to send email reminders to people signed up to different kind of events. Every five minutes the app check for ready reminders and send these. The number or reminders can vary from zero to many at every check.

But here comes the problems:

If for example 3 ready reminder are found at a certain check, and two of these have the same recipient (same email), but different merge_vars because they are about different events. When sent only one (the first found?) set of merge_vars will be used to both of these recipients.

So, how do I keep unique merge_vars even to multiple recipients with the same email? I guess i could split duplicated email adresses into several different calls. But I would really like to do one call, and send one array of recipients. Is it possible?

Upvotes: 4

Views: 1233

Answers (2)

CodeQuiver
CodeQuiver

Reputation: 21

I found an easier workaround than multiple API calls, and confirmed it works. Append a unique identifier to each email address using the "+" symbol. Then multiple emails to the same person will technically be to different email addresses, so Mandrill's merge fields will work correctly. e.g.

[email protected]
[email protected]
[email protected]

All three of these will be delivered with the correct merging to [email protected], and the recipient can even filter by the exact addresses if they wish when searching for the messages later.

(I am having the same issue now in 2019, so assume the original problem hasn't been fixed on Mandrill.)

Edit: The above method will not work with @yahoo.com recipients, as they don't support sub-addressing. The emails will bounce as if the address doesn't exist. (I consider that a problem with Yahoo, not the answer, since it's standard. But anyway, if you are emailing a group with a lot of yahoos... erm, yahoo.com emails I mean, then this method won't help.)

Upvotes: 1

Kaitlin
Kaitlin

Reputation: 6235

At this time, Mandrill uses email addresses as a unique identifier for merge vars in API calls, so it's only possible to provide one set of merge values for an email address, even if you've specified that address multiple times in the messages.to parameter. If you have multiple unique emails to send to the same recipient, that should be handled in separate API calls at this time.

Upvotes: 5

Related Questions