diff --git a/package.json b/package.json index f330679d11c..eb6fb10cbd9 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,7 @@ "prepare": "husky install", "publish": "lerna publish from-package", "setup:project": "npx --yes pnpm@7.33.4 i && node scripts/setup-env-files.js && pnpm build", + "clean": "lerna clean --yes && npm run prebuild", "commit": "cz", "nx": "nx", diff --git a/packages/application-generic/src/factories/mail/handlers/resend.handler.ts b/packages/application-generic/src/factories/mail/handlers/resend.handler.ts index c2ff2108ba7..592c6b275c5 100644 --- a/packages/application-generic/src/factories/mail/handlers/resend.handler.ts +++ b/packages/application-generic/src/factories/mail/handlers/resend.handler.ts @@ -6,10 +6,11 @@ export class ResendHandler extends BaseHandler { constructor() { super('resend', ChannelTypeEnum.EMAIL); } - buildProvider(credentials: ICredentials, from?: string) { - const config: { apiKey: string; from: string } = { + buildProvider(credentials: ICredentials, from?: string, senderName?: string) { + const config: { apiKey: string; from: string; senderName?: string } = { from: from as string, apiKey: credentials.apiKey as string, + senderName, }; this.provider = new ResendEmailProvider(config); diff --git a/providers/resend/src/lib/resend.provider.ts b/providers/resend/src/lib/resend.provider.ts index b8e7823f237..1e0ec103f87 100644 --- a/providers/resend/src/lib/resend.provider.ts +++ b/providers/resend/src/lib/resend.provider.ts @@ -17,6 +17,7 @@ export class ResendEmailProvider implements IEmailProvider { private config: { apiKey: string; from: string; + senderName?: string; } ) { this.resendClient = new Resend(this.config.apiKey); @@ -26,7 +27,9 @@ export class ResendEmailProvider implements IEmailProvider { options: IEmailOptions ): Promise { const response: any = await this.resendClient.sendEmail({ - from: options.from || this.config.from, + from: this.config?.senderName + ? `${this.config?.senderName} <${options.from || this.config.from}>` + : options.from || this.config.from, to: options.to, subject: options.subject, text: options.text,