diff --git a/.env.example b/.env.example index c82423c34ee4d2..95eddc71ac34b0 100644 --- a/.env.example +++ b/.env.example @@ -196,6 +196,10 @@ EMAIL_SERVER_PORT=1025 # Make sure to run mailhog container manually or with `yarn dx` E2E_TEST_MAILHOG_ENABLED= +# Resend +# Send transactional email using resend +# RESEND_API_KEY= + # ********************************************************************************************************** # Set the following value to true if you wish to enable Team Impersonation diff --git a/packages/lib/serverConfig.ts b/packages/lib/serverConfig.ts index 09feb75661d6b9..8a13b31ff22ce0 100644 --- a/packages/lib/serverConfig.ts +++ b/packages/lib/serverConfig.ts @@ -6,6 +6,20 @@ import { isENVDev } from "@calcom/lib/env"; import { getAdditionalEmailHeaders } from "./getAdditionalEmailHeaders"; function detectTransport(): SendmailTransport.Options | SMTPConnection.Options | string { + if (process.env.RESEND_API_KEY) { + const transport = { + host: "smtp.resend.com", + secure: true, + port: 465, + auth: { + user: "resend", + pass: process.env.RESEND_API_KEY, + }, + }; + + return transport; + } + if (process.env.EMAIL_SERVER) { return process.env.EMAIL_SERVER; } diff --git a/turbo.json b/turbo.json index ab654d12ba02c0..f33f3941f7038b 100644 --- a/turbo.json +++ b/turbo.json @@ -337,6 +337,7 @@ "ZOHOCRM_CLIENT_ID", "ZOHOCRM_CLIENT_SECRET", "ZOOM_CLIENT_ID", - "ZOOM_CLIENT_SECRET" + "ZOOM_CLIENT_SECRET", + "RESEND_API_KEY" ] }