Skip to content
This repository was archived by the owner on Jul 21, 2025. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/email.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@ export class EmailService {
to: Many<string>,
template: (props: P) => ReactElement,
props: P,
from?: string,
): Promise<void> {
const { send, open } = this.options;

const msg = await this.render(to, template, props);
const msg = await this.render(to, template, props, from);

if (send) {
await this.sendMessage(msg);
Expand All @@ -51,6 +52,7 @@ export class EmailService {
to: Many<string>,
template: (props: P) => ReactElement,
props: P,
from?: string,
) {
const docEl = this.options.wrappers.reduceRight(
(prev: ReactElement, wrap) => wrap(prev),
Expand All @@ -62,7 +64,7 @@ export class EmailService {
const message = new EmailMessage({
templateName: template.name,
to: to as string[],
from: this.options.from,
from: from || this.options.from,
...(!this.options.replyTo || this.options.replyTo.length === 0
? {}
: {
Expand Down