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?
You have to compose the emails yourself and then just send them to MailGun one by one.
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.