feat: add resend email transport (#12645)

Co-authored-by: Erik <erik@erosemberg.com>
This commit is contained in:
Nafees Nazik 2023-12-05 05:01:55 +05:30 committed by GitHub
parent bb7057ea04
commit 325f250d39
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 1 deletions

View File

@ -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

View File

@ -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;
}

View File

@ -337,6 +337,7 @@
"ZOHOCRM_CLIENT_ID",
"ZOHOCRM_CLIENT_SECRET",
"ZOOM_CLIENT_ID",
"ZOOM_CLIENT_SECRET"
"ZOOM_CLIENT_SECRET",
"RESEND_API_KEY"
]
}