mailgun-js-boland
mailgun-js-boland copied to clipboard
Send to mailing list example?
Is there a way to send to a mailing list passing in a template? do you just use message().send() with the mailing list as the address? Or is there other example code I haven't been able to find?
Thanks
Hey,
I don't know what do you mean by mailing list passing in a template but if you just want to send message to mails that you have in mailing list it's simple ->
const data = {
from: '[email protected]',
to: '[email protected]', <- here you put your mailing list name before @
subject: 'Example message',
html: '<p>Example message</p>'
}
await mg.messages().send(data, function(error, body) {
return error
})
Hope I helped 👍