Using lists inside variable recipients when using Mailgun batch sending

I have the following use case:

Batch send invoice via Mailgun

Basically I need to combine these functions: - recipient variables so that each recipient receives a personalized email - each recipient variable contains a list of ordered items - each item has the following properties: Name, Price, Amount, etc.

I know how to use simple variables like

 Dear <%recipient.FirstName%>, today is <%recipient.Date%>

      

But in this case the pattern is more complex, something like this (pseudocode)

 Dear <%recipient.FirstName%>, these are the ordered items:
 <%each recipient.Ordered
  <%item.Name%> ...... <%item.Amount%>, <%item.Price%>
 each%>

      

Is this even possible with MailGun?

Or do I have to compose the emails myself and then just send them to MailGun one by one?

+3


source to share


2 answers


You have to compose the emails yourself and then just send them to MailGun one by one.



+1


source


Since you are passing the JSON object to the list when you create it, I suppose you could have a structure like recipient.Sales.Item1, recipient.Sales.Item2 ...



I would probably try this first. It seems easier, but then again, it just never happens.

-1


source







All Articles