Skip to content

Scheduling infrastructure for absolutely everyone.

feat: add resend email transport (#12645)

Nafees Nazik325f250d3964
diff --git a/.env.example b/.env.example
index c82423c34ee..95eddc71ac3 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 09feb75661d..8a13b31ff22 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 ab654d12ba0..f33f3941f70 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"
]
}