Skip to content

options.template property causes failure with some transport types. #1828

Closed

Description

@sharkinsspatial

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

Activity

  1. Amir-61 commented on Nov 20, 2015

    @Amir-61
    Member

    Hi @sharkinsspatial,

    Thanks! Could you please share a repo to reproduce the issue? You can use loopback-sandbox to reproduce the issue (Please see: https://github.com/strongloop/loopback-sandbox).

    Thanks!

  2. self-assigned this
    on Nov 20, 2015
  3. sharkinsspatial commented on Nov 20, 2015

    @sharkinsspatial
    Author

    Hi @Amir-61, steps to reproduce are included in the README in the forked loopback-sandbox here.

  4. assigned and unassigned on Nov 20, 2015
  5. Amir-61 commented on Nov 20, 2015

    @Amir-61
    Member

    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.

  6. sharkinsspatial commented on Nov 20, 2015

    @sharkinsspatial
    Author

    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.

  7. Amir-61 commented on Nov 21, 2015

    @Amir-61
    Member

    Hey @sharkinsspatial,

    Yes you are more than welcome to contribute the code and submit the pull request.

    Thanks for reporting the issue!

  8. added a commit that references this issue on Nov 23, 2015
  9. 7 remaining items

  10. superkhau commented on Dec 8, 2015

    @superkhau
    Contributor

    Spoke with @Amir-61 over Slack, he is digging into it more.

  11. Amir-61 commented on Dec 8, 2015

    @Amir-61
    Member

    I eventually could successfully reproduce the bug.

  12. added and removed on Dec 10, 2015
  13. added and removed on Dec 15, 2015
  14. stale commented on Aug 23, 2017

    @stale

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions