Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Send to mailing list example? #256

Open
oristian opened this issue Jan 23, 2020 · 1 comment
Open

Send to mailing list example? #256

oristian opened this issue Jan 23, 2020 · 1 comment

Comments

@oristian
Copy link

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

@SerekKiri
Copy link

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: 'your@domain.com',
      to: 'mailing_list_name@yourdomain.com', <- 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 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants