How to configure Meteor to use Amazon SAS when working on Heroku?

I would like to use the built-in email methods that Meteor provides, but I need my application to run on Heroku and use the smtp endpoint for Amazon SES to transfer my message.

I use the Meteorite build and the account password package.

+7
source share
2 answers

Follow the instructions below to get meteor letters from geroku correctly using amazon ses

1) configure smtp access through aws console, get your smtp credentials

2) using javascript console (chrome dev tools / firebug) run

encodeURIComponent("SES_SMTP_USERNAME")

encodeURIComponent("SES_SMTP_PASSWORD")

to encode username / password to use in your smtp url

3) take the result lines to build your smtp url, for example:

smtp://ENCODED_USER: ENCODED_PASS@SES _SMTP_URL:465

4) set the MAIL_URL variable to tell the meteor to use this method to send letters

heroku config:add MAIL_URL=YOUR_SMTP_URL

(do not repeat url with qoutes)

5) set the sender as a SES-confirmed sender in your meteor application via

Accounts.emailTemplates.from = "SENDER_NAME <SENDER_EMAIL>";


This will allow the default Meteor email methods to function properly.

+14
source

In addition to what you suggested in your gist, you can also use the Meteor.http methods with the SES API and send a POST / GET request.

Full API documents at http://docs.aws.amazon.com/ses/latest/DeveloperGuide/QueryInterface.Examples.html

Of course, this is a manual solution and does not use the built-in meteor shower method. However, it can be fixed by overriding the mail function via Email.send = function(...

UPDATE

You can also use the email package in the atmosphere.

 mrt add email-ses 

More information here: https://atmospherejs.com/package/email-ses

0
source

All Articles