dwyl / sendemail

💌 Simplifies reliably sending emails from your node.js apps using AWS Simple Email Service (SES)
181 stars 26 forks source link

Error when trying to send a test email #32

Closed Conorc1000 closed 7 years ago

Conorc1000 commented 8 years ago

I have attempted to set up sendemail https://github.com/OxfordAbstracts/application/tree/abb964f5ed020d8e65abd47e57e89a231ee575dc/src but when I try to run my email.js file i get the following error,

screen shot 2016-05-04 at 14 56 12

Could this be because the the sendemail module is not able to find my config.env file?

iteles commented 8 years ago

Ah, the mandrill error may be more telling than you think in this @Conorc1000 as we're replacing Mandrill with SES

nelsonic commented 8 years ago

@Conorc1000 good question. Which version of sendemail are you using? see: https://github.com/dwyl/sendemail/blob/d5bdaa1f14fd8cf5a8ef9aae074963678c9dcab9/lib/index.js#L1

Conorc1000 commented 8 years ago

im using 2.14.7

nelsonic commented 8 years ago

there's your problem... go with v.2.0.0 :wink:

On Wed, May 4, 2016 at 4:01 PM, Conor Campbell notifications@github.com wrote:

"sendemail": "^1.0.9",

— You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/dwyl/sendemail/issues/32#issuecomment-216893143

nelsonic commented 8 years ago

@Conorc1000 are you still having issues sending email? can you describe the steps you've gone through and/or link to the branch where your code is?

Conorc1000 commented 8 years ago

Hi @nelsonic yes changing the version of the module fixed the mandrill error. However now there is this error.

screen shot 2016-05-05 at 09 56 02

Here is the link to the branch

https://github.com/OxfordAbstracts/application/tree/abb964f5ed020d8e65abd47e57e89a231ee575dc

see application/src/sendEmail/

I have set up my AWS account with SES, and the email address I am trying to send to is verified within the sand box environment. I have also had my account upgraded so that emails can be sent outside of the sandbox environment.

nelsonic commented 8 years ago

@Conorc1000 which email address is it complaining about? I'd recommend you update to version 2.0.1 of sendemail and ensure you have the SENDER_EMAIL_ADDRESS environment variable set to an email address that you have verified on AWS SNS. see:https://github.com/dwyl/sendemail#2-set-your-environment-variables

Conorc1000 commented 8 years ago

ok i've changed to v2.0.1 and ive added a sender email, my gmail account linked and verified on my AWS account. The problem now seems to be the file paths

screen shot 2016-05-05 at 12 31 18

I cant seem to find a way of getting the right path to my templates. Could this be because im trying to just run the email.js file by itself node /Users/conorcampbell/Documents/DWYL/application/src/sendEmail/email.js and not running the whole server?

nelsonic commented 8 years ago

Running the file by its' self should not cause you issues. The issue is in relative path of templates directory...

Conorc1000 commented 8 years ago

The code works if I remove line 19 from index.js in the module.

screen shot 2016-05-05 at 13 47 29

Is this a feasible fix?

nelsonic commented 8 years ago

@Conorc1000 sure, if that works for you and the tests still pass, please PR the change. 👍

nelsonic commented 8 years ago

@Conorc1000 still seeing this issue? (if not please close...)

Conorc1000 commented 7 years ago

Yes Sendemail is working well