Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor mailer and add connection test #2074

Merged
merged 7 commits into from
Oct 5, 2018
Merged

Conversation

taylortom
Copy link
Member

@taylortom taylortom commented Sep 12, 2018

Fixes #2072.

TODO: needs to be integrated with the new dependency checks once they're in.

@taylortom taylortom added this to the 0.5.1 milestone Sep 12, 2018
@lc-thomasberger
Copy link
Member

Will this allow us to send different templates with the mailer?

@taylortom
Copy link
Member Author

taylortom commented Sep 13, 2018

That should be possible already (but I've added a few related fixes to this). It should be possible by adding your templates to lib/templates, then referencing this like:

app.mailer.send('[email protected]', 'Subject', 'Body', { name: 'path/to/template.hbs' }, callback);

You can also add extra bits of dynamic data to the 4th param, and reference this in your template (we should maybe change this, so that these can be added directly to the template options):

{ 
  name: 'path/to/template.hbs', 
  hello: 'world' 
}
<p class="text">
  Hello {{{templateData.hello}}}
</p>

* @param {String} toAddress Address to send mail to
* @param {String} subject Email subject line
* @param {String} text Email body
* @param {Object} templateData
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optional?

Copy link
Member

@lc-thomasberger lc-thomasberger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tested with gmail

@lc-thomasberger lc-thomasberger merged commit 484b641 into release/0.5.1 Oct 5, 2018
@lc-thomasberger lc-thomasberger deleted the issue/2072 branch October 5, 2018 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants