lookback / meteor-emails

Improved Meteor emails with templating, previews and automated CSS/SCSS inlining.

Home Page:https://atmospherejs.com/lookback/emails

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Emails not sending, using Mandrill

petr24 opened this issue · comments

Hey love the package so far, but I am experiencing a weird issue.

I have Mandrill setup for sending emails, and when I send an email via url route it works and I verify that on mandrill logs where status = "sent", also I receive the email in my inbox. If I do

var emailHtml = Mailer.render(emailObject);
Meteor.Mandrill.send({
...,
...,
...,
html: emailHtml
});

it also works, however, when I do

Mailer.send(emailObject);

It doesn't work, and I verify that through mandrill logs, because it gets sent but the status on the email is status = "invalid" and I never end up receiving the email in my inbox. Any Ideas on what might be happening?

Hi there!

Weird indeed. Is the Meteor server log saying anything?

Hey,

Nothing in the logs, unless there is some extra logging that I can turn on, not sure.
And if I make Mailer.send() into a var, it returns true in the logs.
So not to sure what could be causing the hiccup.

Are you able to clone this repo and run the sample app, and send an email from there? Also please ensure you have a MAIL_URL environment variable setup.

I haven't tried sending an email from the demo app, and I am setting the MAIL_URL like so in the Meteor.startup server side, not sure if thats the correct way.

process.env.MAIL_URL = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxx@smtp.mandrillapp.com:587';

Okay. That should work. I usually put it into the boot of the app:

MAIL_URL="xxx@mail.com:465" meteor --port 3000

Hmm, tried that also, but still getting a status = "invalid" in the mandrill log. Ill keep playing with it.

@johanbrook,

Where could I find how you handle sending the email via the route url, because that works without any kind of issue.

Ok, so good news bad news situation. I was misspelling the "to" email in the object and that was causing the error. So good news is no bug with the package, bad news is I am an idiot lol.

Haha ;) Don't be so hard on yourself! It happens.

(even though I find it weird that an error wasn't thrown on your misspelling: I check the object arguments to sendEmail here: https://github.com/lookback/meteor-emails/blob/master/emails.coffee#L215).