Skip to content
This repository was archived by the owner on Sep 25, 2024. It is now read-only.

Conversation

@damon-t
Copy link

@damon-t damon-t commented Dec 16, 2021

No description provided.

Copy link
Contributor

@filipenevola filipenevola left a 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,
Copy link
Contributor

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
Copy link
Contributor

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) => {
Copy link
Contributor

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;
Copy link
Contributor

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.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants