You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
options.template property causes failure with some transport types. #1828
Some nodemailer transport types fail when the template property is included in the options object. Notably when using Mailgun. The template property is only used to eventually populate the options.html property and should be not be passed on in the options object to Email.send
Thanks @sharkinsspatial for providing steps and loopback-sandbox! To be honest I could not reproduce your error message. I'm getting a different error message (forbidden error); not sure if I can use Mailgun right after signing up or it takes some time to have the service available... Also, it is worth mentioning that Model Hooks are now deprecated and instead you can use operation hooks.
I believe you will receive a verification email from Mailgun which you will need to confirm to activate the account. Also note that the api key should be prefixed by 'key-' (I made this mistake when I first entered mine). I will look into using operation hooks rather than the deprecated model hooks. I was following the technique outlined in the user registration section of the documentation. Maybe I should submit an issue/pull-request to update this section of the documentation?
Regardless, reproducing the issue may not really be necessary. It appears to me that options.template is only used to generate the body of the email and is unnecessary after that. I'm unaware of any nodemailer transport plugins that use template and Mailgun will not accept it so I think the property should be deleted after the html is generated rather than passed on to nodemailer. Would it be preferable if I submit a pull-request.
This issue has been closed due to continued inactivity. Thank you for your understanding. If you believe this to be in error, please contact one of the code owners, listed in the CODEOWNERS file at the top-level of this repository.
Activity
Amir-61 commentedon Nov 20, 2015
Hi @sharkinsspatial,
Thanks! Could you please share a repo to reproduce the issue? You can use
loopback-sandboxto reproduce the issue (Please see: https://github.com/strongloop/loopback-sandbox).Thanks!
Include Mailgun transport for user.verify to reproduce strongloop/loo…
sharkinsspatial commentedon Nov 20, 2015
Hi @Amir-61, steps to reproduce are included in the README in the forked
loopback-sandboxhere.Amir-61 commentedon Nov 20, 2015
Thanks @sharkinsspatial for providing steps and
loopback-sandbox! To be honest I could not reproduce your error message. I'm getting a different error message (forbidden error); not sure if I can use Mailgun right after signing up or it takes some time to have the service available... Also, it is worth mentioning that Model Hooks are now deprecated and instead you can use operation hooks.sharkinsspatial commentedon Nov 20, 2015
I believe you will receive a verification email from Mailgun which you will need to confirm to activate the account. Also note that the api key should be prefixed by 'key-' (I made this mistake when I first entered mine). I will look into using operation hooks rather than the deprecated model hooks. I was following the technique outlined in the user registration section of the documentation. Maybe I should submit an issue/pull-request to update this section of the documentation?
Regardless, reproducing the issue may not really be necessary. It appears to me that options.template is only used to generate the body of the email and is unnecessary after that. I'm unaware of any nodemailer transport plugins that use template and Mailgun will not accept it so I think the property should be deleted after the html is generated rather than passed on to nodemailer. Would it be preferable if I submit a pull-request.
Amir-61 commentedon Nov 21, 2015
Hey @sharkinsspatial,
Yes you are more than welcome to contribute the code and submit the pull request.
Thanks for reporting the issue!
Fixes issue strongloop#1828
7 remaining items
superkhau commentedon Dec 8, 2015
Spoke with @Amir-61 over Slack, he is digging into it more.
Amir-61 commentedon Dec 8, 2015
I eventually could successfully reproduce the bug.
stale commentedon Aug 23, 2017
This issue has been closed due to continued inactivity. Thank you for your understanding. If you believe this to be in error, please contact one of the code owners, listed in the
CODEOWNERSfile at the top-level of this repository.