From 7ddc0345dc6a7d26679779c50dc36483ba333695 Mon Sep 17 00:00:00 2001 From: Hannes Ortmeier Date: Tue, 21 May 2024 00:57:51 +0200 Subject: [PATCH 1/4] Add optional replyTo field to Email type --- .../data/Generator/templates/sdk/wasp/server/email/core/types.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/waspc/data/Generator/templates/sdk/wasp/server/email/core/types.ts b/waspc/data/Generator/templates/sdk/wasp/server/email/core/types.ts index 6349a7cd0d..238175658e 100644 --- a/waspc/data/Generator/templates/sdk/wasp/server/email/core/types.ts +++ b/waspc/data/Generator/templates/sdk/wasp/server/email/core/types.ts @@ -45,6 +45,7 @@ export type Email = { {=^ isDefaultFromFieldDefined =} from: EmailFromField; {=/ isDefaultFromFieldDefined =} + replyTo?: string; to: string; subject: string; text: string; From adae95b7afbdbbb73095b713d78c49376a8d82d7 Mon Sep 17 00:00:00 2001 From: Hannes Ortmeier Date: Tue, 21 May 2024 00:58:21 +0200 Subject: [PATCH 2/4] Add optional replyTo field to SendGrid provider --- .../templates/sdk/wasp/server/email/core/providers/sendgrid.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/waspc/data/Generator/templates/sdk/wasp/server/email/core/providers/sendgrid.ts b/waspc/data/Generator/templates/sdk/wasp/server/email/core/providers/sendgrid.ts index e5a4ffc4eb..cac34e2b5f 100644 --- a/waspc/data/Generator/templates/sdk/wasp/server/email/core/providers/sendgrid.ts +++ b/waspc/data/Generator/templates/sdk/wasp/server/email/core/providers/sendgrid.ts @@ -4,7 +4,7 @@ import type { SendGridProvider, EmailSender } from "../types"; // PRIVATE API export function initSendGridEmailSender( - provider: SendGridProvider + provider: SendGridProvider ): EmailSender { SendGrid.setApiKey(provider.apiKey); @@ -18,6 +18,7 @@ export function initSendGridEmailSender( email: fromField.email, name: fromField.name, }, + replyTo: email.replyTo, to: email.to, subject: email.subject, text: email.text, From 1120faee609f8c10886abf22d259e4b58046f243 Mon Sep 17 00:00:00 2001 From: Hannes Ortmeier Date: Tue, 21 May 2024 00:58:32 +0200 Subject: [PATCH 3/4] Document replyTo field for SendGrid provider --- web/docs/advanced/email/email.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/web/docs/advanced/email/email.md b/web/docs/advanced/email/email.md index d6288dc57c..30a6f9ce09 100644 --- a/web/docs/advanced/email/email.md +++ b/web/docs/advanced/email/email.md @@ -384,6 +384,10 @@ The `send` method accepts an object with the following fields: The email address of the sender. +- `replyTo?: string` + + The email address to which the recipient can reply to. Only available for SendGrid provider. + - `to: string` The recipient's email address. From 3729381ab76cb40c6e3f918c0ec999559c957015 Mon Sep 17 00:00:00 2001 From: Hannes Ortmeier Date: Tue, 21 May 2024 01:10:43 +0200 Subject: [PATCH 4/4] Update changelog.md --- waspc/ChangeLog.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/waspc/ChangeLog.md b/waspc/ChangeLog.md index c87b8b8c51..b50253f535 100644 --- a/waspc/ChangeLog.md +++ b/waspc/ChangeLog.md @@ -1,5 +1,11 @@ # Changelog +## 0.13.3 (TBD) + +### 🎉 New features + +- Wasp now supports the replyTo field in the emailSender.send method. This field allows you to specify the email address to which the recipient can reply to. This feature is only available for the SendGrid provider. + ## 0.13.2 (2024-04-11) ### 🐞 Bug fixes