From 4ce1d936c717f0f1096be744bbd8461f7aba262a Mon Sep 17 00:00:00 2001 From: Pawan Jain Date: Wed, 10 Apr 2024 09:54:15 +0530 Subject: [PATCH 1/3] feat: add reply to field in resend --- providers/resend/src/lib/resend.provider.spec.ts | 2 ++ providers/resend/src/lib/resend.provider.ts | 1 + 2 files changed, 3 insertions(+) diff --git a/providers/resend/src/lib/resend.provider.spec.ts b/providers/resend/src/lib/resend.provider.spec.ts index 31cde396fd3..aa6ce0cd2b7 100644 --- a/providers/resend/src/lib/resend.provider.spec.ts +++ b/providers/resend/src/lib/resend.provider.spec.ts @@ -13,6 +13,7 @@ const mockNovuMessage = { to: ['test@test.com'], html: '
Mail Content
', subject: 'Test subject', + replyTo: 'no-reply@novu.co', attachments: [ { mime: 'text/plain', @@ -40,6 +41,7 @@ test('should trigger resend library correctly', async () => { html: mockNovuMessage.html, subject: mockNovuMessage.subject, attachments: mockNovuMessage.attachments, + replyTo: mockNovuMessage.replyTo, }); }); diff --git a/providers/resend/src/lib/resend.provider.ts b/providers/resend/src/lib/resend.provider.ts index bb7f6d72595..77bcdf53b1a 100644 --- a/providers/resend/src/lib/resend.provider.ts +++ b/providers/resend/src/lib/resend.provider.ts @@ -36,6 +36,7 @@ export class ResendEmailProvider implements IEmailProvider { text: options.text, html: options.html, cc: options.cc, + reply_to: options.replyTo, attachments: options.attachments?.map((attachment) => ({ filename: attachment?.name, content: attachment.file, From 9e6a989566607c4a817f5c76dc3eb3297b8f2a1d Mon Sep 17 00:00:00 2001 From: Pawan Jain Date: Wed, 10 Apr 2024 10:39:28 +0530 Subject: [PATCH 2/3] fix: failing test --- providers/resend/src/lib/resend.provider.spec.ts | 4 ++-- providers/resend/src/lib/resend.provider.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/providers/resend/src/lib/resend.provider.spec.ts b/providers/resend/src/lib/resend.provider.spec.ts index aa6ce0cd2b7..d3b42c7cb3c 100644 --- a/providers/resend/src/lib/resend.provider.spec.ts +++ b/providers/resend/src/lib/resend.provider.spec.ts @@ -13,7 +13,7 @@ const mockNovuMessage = { to: ['test@test.com'], html: '
Mail Content
', subject: 'Test subject', - replyTo: 'no-reply@novu.co', + reply_to: 'no-reply@novu.co', attachments: [ { mime: 'text/plain', @@ -41,7 +41,7 @@ test('should trigger resend library correctly', async () => { html: mockNovuMessage.html, subject: mockNovuMessage.subject, attachments: mockNovuMessage.attachments, - replyTo: mockNovuMessage.replyTo, + reply_to: mockNovuMessage.reply_to, }); }); diff --git a/providers/resend/src/lib/resend.provider.ts b/providers/resend/src/lib/resend.provider.ts index 77bcdf53b1a..597fba28220 100644 --- a/providers/resend/src/lib/resend.provider.ts +++ b/providers/resend/src/lib/resend.provider.ts @@ -36,7 +36,7 @@ export class ResendEmailProvider implements IEmailProvider { text: options.text, html: options.html, cc: options.cc, - reply_to: options.replyTo, + reply_to: options.replyTo || null, attachments: options.attachments?.map((attachment) => ({ filename: attachment?.name, content: attachment.file, From 4f038fc5e7f618692e15afae16f45c4c88f8b5ad Mon Sep 17 00:00:00 2001 From: Pawan Jain Date: Wed, 10 Apr 2024 12:37:35 +0530 Subject: [PATCH 3/3] fix: failing test with null --- providers/resend/src/lib/resend.provider.spec.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/providers/resend/src/lib/resend.provider.spec.ts b/providers/resend/src/lib/resend.provider.spec.ts index d3b42c7cb3c..e3a492e8516 100644 --- a/providers/resend/src/lib/resend.provider.spec.ts +++ b/providers/resend/src/lib/resend.provider.spec.ts @@ -71,6 +71,7 @@ test('should trigger resend email with From Name', async () => { filename: attachment?.name, content: attachment.file, })), + reply_to: null, cc: undefined, bcc: undefined, });