-
Notifications
You must be signed in to change notification settings - Fork 3
add more options #1
base: main
Are you sure you want to change the base?
Conversation
change package name back to original package for PR
change package name back to original
filipenevola
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few questions and recommendations.
Also a required change.
See the comments.
| To: to, | ||
| Subject: subject, | ||
| HtmlBody: content, | ||
| To: options.to, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the behavior of postmark if the optional fields are undefined?
| Headers: [ | ||
| { | ||
| Name: "Message-ID", | ||
| Value: options.messageId |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the behavior of postmark if these fields are provided but undefined?
|
|
||
| export const sendEmail = async ({ to, subject, content, from: fromParam }) => { | ||
| const from = fromParam || settings.from; | ||
| export const sendEmail = async (options) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a function call without any arg would break in the next line.
it would be better to have async (options = {}) to avoid undefined errors destructing args.
| const overrideOptions = Email.overrideOptionsBeforeSend | ||
| ? Email.overrideOptionsBeforeSend(options) | ||
| : {}; | ||
| const { to, html} = options; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
overrideOptionsBeforeSend is an email from the Email package of Meteor so we should continue supporting it.
It's going to be called outside the user flow here in this code so it's necessary.
No description provided.