You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This was prior to Mailgun supporting templates stored in mailgun; so the parameter name templateVars is now ambiguous/misleading
To use a template stored in mailgun, you should be able to with:
mailer.send('[email protected]','Hello','',// Body is blank{},// Recipient vars is blank{// Send options parameter allows passing info directly to Mailguntemplate: 'my-template','h:X-Mailgun-Variables': ...
});
Please let me know if this works or not and I can troubleshoot. Any PRs or suggestions to improve this functionality or to improve the documentation would be greatly appreciated!
Thanks @DrewImm , I made the necessary code changes and this worked fine.
I did try to create a branch yesterday but it said I didn't have the right privileges. Is this something you need to enable?
I was just going to tackle this specific use case in the docs.
I had an issue with trying to pass variables into a template that was in the Mailgun UI using the send() command.
Following the documentation for ts-mailgun, nothing would transfer the data across to the template when using the templateVars object in send().
After looking through the mailgun documentation, i found this example curl for sending an email.
Yet i noticed in dist/ts-mailgun.js that the send body is this:
By changing
recipient-variables
toh:X-Mailgun-Variables
I achieved the desired result and the variables passed through successfully.I am happy to open a PR with the changes if that is suitable?
The text was updated successfully, but these errors were encountered: