Skip to content

Commit

Permalink
fix: mail-factory to handle 'to' field more effectively
Browse files Browse the repository at this point in the history
Adjusted 'to' field logic for better handling of email recipients.
  • Loading branch information
schettn committed Mar 13, 2024
1 parent fca9057 commit 054bb6b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .pylon/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -57853,7 +57853,7 @@ class MailFactory {
const emailEnvelope = await emailTemplate.envelope();
let combinedEnvelope = {
subject: emailEnvelope?.subject || envelope?.subject || "No subject",
to: (emailEnvelope?.to || []).length > 0 ? envelope?.to || [] : [],
to: (emailEnvelope?.to || []).length === 0 ? envelope?.to : [],
replyTo: emailEnvelope?.replyTo || envelope?.replyTo || undefined,
};
const variables = await emailTemplate?.variables();
Expand Down
2 changes: 1 addition & 1 deletion .pylon/index.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/services/mail-factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ export class MailFactory {

let combinedEnvelope = {
subject: emailEnvelope?.subject || envelope?.subject || "No subject",
to: (emailEnvelope?.to || []).length > 0 ? envelope?.to || [] : [],
to: (emailEnvelope?.to || []).length === 0 ? envelope?.to : [],
replyTo: emailEnvelope?.replyTo || envelope?.replyTo || undefined,
};

Expand Down

0 comments on commit 054bb6b

Please sign in to comment.