Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Meteor verification, enrollment, etc. email via 3rd party mailer

Tags:

meteor

I'd love to have Meteor use a 3rd party API (in my case, Mandrill) for sendVerificationEmail, sendEnrollmentEmail, etc. Has anyone gotten this working?

EDIT: Specifically, I'd like to use templates I have in Mandrill for these system emails. I imagine that I'll have to change some functions in the Accounts package to send names, tokens etc. to Mandrill via an API call. If anyone has done this already, I'd love to hear about it.

like image 890
bengreene Avatar asked Jul 24 '14 14:07

bengreene


2 Answers

Super easy to do this with the mandrill package on atmosphere

meteor add timmyg13:mandrill

Then its just setting it up on your server side:

# in server code
Meteor.startup(function() {
    Meteor.Mandrill.config({
        username: "YOUR_MANDRILL_USERNAME",
        key: "YOUR_MANDRILL_API_KEY"
    });
});

And you're set!

The way it does this is it sets your smtp url to the mandrill smtp server, so anything using Meteor's email package will work (like accounts-password)

like image 55
Tarang Avatar answered Nov 09 '22 20:11

Tarang


just change "process.env.MAIL_URL" variable and use something like this:

this.process.env.MAIL_URL = "smtp://{{foobar%40gmail.com}}:{{apikey}}@smtp.mandrillapp.com:587/";

the package that @Akshat said do just that, and as he mentioned the username and apikey should be generated with "encodeURIComponent"

like image 1
Julio Marins Avatar answered Nov 09 '22 18:11

Julio Marins