Scheduling infrastructure for absolutely everyone.
feat: adds env variable for email sender name (#15598)
Dilpreet Singh3e10e2db3666
diff --git a/.env.example b/.env.exampleindex fe36f111160..08c44c5c3b4 100644--- a/.env.example+++ b/.env.example@@ -180,6 +180,7 @@ API_KEY_PREFIX=cal_# allow access to the nodemailer transports from the .env file. E-mail templates are accessible within lib/emails/# Configures the global From: header whilst sending emails.EMAIL_FROM='[email protected]'+EMAIL_FROM_NAME='Cal.com'# Configure SMTP settings (@see https://nodemailer.com/smtp/).# Configuration to receive emails locally (mailhog)diff --git a/packages/emails/templates/account-verify-email.ts b/packages/emails/templates/account-verify-email.tsindex 6c8871ec88f..cbad2a6b1b9 100644--- a/packages/emails/templates/account-verify-email.ts+++ b/packages/emails/templates/account-verify-email.ts@@ -1,6 +1,6 @@import type { TFunction } from "next-i18next";-import { APP_NAME, COMPANY_NAME } from "@calcom/lib/constants";+import { APP_NAME, COMPANY_NAME, EMAIL_FROM_NAME } from "@calcom/lib/constants";import { renderEmail } from "../";import BaseEmail from "./_base-email";@@ -30,7 +30,7 @@ export default class AccountVerifyEmail extends BaseEmail {: "verify_email_subject";return {to: `${this.verifyAccountInput.user.name} <${this.verifyAccountInput.user.email}>`,- from: `${APP_NAME} <${this.getMailerOptions().from}>`,+ from: `${EMAIL_FROM_NAME} <${this.getMailerOptions().from}>`,subject: this.verifyAccountInput.language(emailSubjectKey, {appName: APP_NAME,}),diff --git a/packages/emails/templates/admin-organization-notification.ts b/packages/emails/templates/admin-organization-notification.tsindex 01b6f469ab8..7c277a04f8a 100644--- a/packages/emails/templates/admin-organization-notification.ts+++ b/packages/emails/templates/admin-organization-notification.ts@@ -1,6 +1,6 @@import type { TFunction } from "next-i18next";-import { APP_NAME } from "@calcom/lib/constants";+import { EMAIL_FROM_NAME } from "@calcom/lib/constants";import { renderEmail } from "../";import BaseEmail from "./_base-email";@@ -24,7 +24,7 @@ export default class AdminOrganizationNotification extends BaseEmail {protected async getNodeMailerPayload(): Promise<Record<string, unknown>> {return {- from: `${APP_NAME} <${this.getMailerOptions().from}>`,+ from: `${EMAIL_FROM_NAME} <${this.getMailerOptions().from}>`,to: this.input.instanceAdmins.map((admin) => admin.email).join(","),subject: `${this.input.t("admin_org_notification_email_subject")}`,html: await renderEmail("AdminOrganizationNotificationEmail", {diff --git a/packages/emails/templates/attendee-request-email.ts b/packages/emails/templates/attendee-request-email.tsindex 3f5d555b7c6..24e36538e44 100644--- a/packages/emails/templates/attendee-request-email.ts+++ b/packages/emails/templates/attendee-request-email.ts@@ -1,4 +1,4 @@-import { APP_NAME } from "@calcom/lib/constants";+import { EMAIL_FROM_NAME } from "@calcom/lib/constants";import { renderEmail } from "../";import AttendeeScheduledEmail from "./attendee-scheduled-email";@@ -8,7 +8,7 @@ export default class AttendeeRequestEmail extends AttendeeScheduledEmail {const toAddresses = this.calEvent.attendees.map((attendee) => attendee.email);return {- from: `${APP_NAME} <${this.getMailerOptions().from}>`,+ from: `${EMAIL_FROM_NAME} <${this.getMailerOptions().from}>`,to: toAddresses.join(","),replyTo: [...this.calEvent.attendees.map(({ email }) => email), this.calEvent.organizer.email],subject: `${this.calEvent.attendees[0].language.translate("booking_submitted_subject", {diff --git a/packages/emails/templates/attendee-verify-email.ts b/packages/emails/templates/attendee-verify-email.tsindex 2c34a49cc8c..5024fe0089a 100644--- a/packages/emails/templates/attendee-verify-email.ts+++ b/packages/emails/templates/attendee-verify-email.ts@@ -1,6 +1,6 @@import type { TFunction } from "next-i18next";-import { APP_NAME, COMPANY_NAME } from "@calcom/lib/constants";+import { APP_NAME, COMPANY_NAME, EMAIL_FROM_NAME } from "@calcom/lib/constants";import { renderEmail } from "../";import BaseEmail from "./_base-email";@@ -27,7 +27,7 @@ export default class AttendeeVerifyEmail extends BaseEmail {protected async getNodeMailerPayload(): Promise<Record<string, unknown>> {return {to: `${this.verifyAccountInput.user.name} <${this.verifyAccountInput.user.email}>`,- from: `${APP_NAME} <${this.getMailerOptions().from}>`,+ from: `${EMAIL_FROM_NAME} <${this.getMailerOptions().from}>`,subject: this.verifyAccountInput.language(`verify_email_subject${this.verifyAccountInput.isVerifyingEmail ? "_verifying_email" : ""}`,{diff --git a/packages/emails/templates/attendee-was-requested-to-reschedule-email.ts b/packages/emails/templates/attendee-was-requested-to-reschedule-email.tsindex 09310c816cb..579f46a947e 100644--- a/packages/emails/templates/attendee-was-requested-to-reschedule-email.ts+++ b/packages/emails/templates/attendee-was-requested-to-reschedule-email.ts@@ -1,5 +1,5 @@import { getManageLink } from "@calcom/lib/CalEventParser";-import { APP_NAME } from "@calcom/lib/constants";+import { EMAIL_FROM_NAME } from "@calcom/lib/constants";import type { CalendarEvent } from "@calcom/types/Calendar";import { renderEmail } from "..";@@ -30,7 +30,7 @@ export default class AttendeeWasRequestedToRescheduleEmail extends OrganizerSche}),method: "REQUEST",},- from: `${APP_NAME} <${this.getMailerOptions().from}>`,+ from: `${EMAIL_FROM_NAME} <${this.getMailerOptions().from}>`,to: toAddresses.join(","),subject: `${this.t("requested_to_reschedule_subject_attendee", {eventType: this.calEvent.type,diff --git a/packages/emails/templates/booking-redirect-notification.ts b/packages/emails/templates/booking-redirect-notification.tsindex 6a6a97c1eae..5630c01ec9e 100644--- a/packages/emails/templates/booking-redirect-notification.ts+++ b/packages/emails/templates/booking-redirect-notification.ts@@ -1,6 +1,6 @@import type { TFunction } from "next-i18next";-import { APP_NAME } from "@calcom/lib/constants";+import { EMAIL_FROM_NAME } from "@calcom/lib/constants";import { renderEmail } from "..";import BaseEmail from "./_base-email";@@ -25,7 +25,7 @@ export default class BookingRedirectNotification extends BaseEmail {protected async getNodeMailerPayload(): Promise<Record<string, unknown>> {return {to: `${this.bookingRedirect.toName} <${this.bookingRedirect.toEmail}>`,- from: `${APP_NAME} <${this.getMailerOptions().from}>`,+ from: `${EMAIL_FROM_NAME} <${this.getMailerOptions().from}>`,subject: this.bookingRedirect.language("booking_redirect_email_subject"),html: await renderEmail("BookingRedirectEmailNotification", {...this.bookingRedirect,diff --git a/packages/emails/templates/broken-integration-email.ts b/packages/emails/templates/broken-integration-email.tsindex b1aaddb1757..14555256ce3 100644--- a/packages/emails/templates/broken-integration-email.ts+++ b/packages/emails/templates/broken-integration-email.ts@@ -1,7 +1,7 @@import type { TFunction } from "next-i18next";import { getRichDescription } from "@calcom/lib/CalEventParser";-import { APP_NAME } from "@calcom/lib/constants";+import { EMAIL_FROM_NAME } from "@calcom/lib/constants";import { TimeFormat } from "@calcom/lib/timeFormat";import type { CalendarEvent } from "@calcom/types/Calendar";@@ -25,7 +25,7 @@ export default class BrokenIntegrationEmail extends BaseEmail {const toAddresses = [this.calEvent.organizer.email];return {- from: `${APP_NAME} <${this.getMailerOptions().from}>`,+ from: `${EMAIL_FROM_NAME} <${this.getMailerOptions().from}>`,to: toAddresses.join(","),subject: `[Action Required] ${this.t("confirmed_event_type_subject", {eventType: this.calEvent.type,diff --git a/packages/emails/templates/change-account-email-verify.ts b/packages/emails/templates/change-account-email-verify.tsindex 5184fb057f2..e5c75230f8e 100644--- a/packages/emails/templates/change-account-email-verify.ts+++ b/packages/emails/templates/change-account-email-verify.ts@@ -1,6 +1,6 @@import type { TFunction } from "next-i18next";-import { APP_NAME, COMPANY_NAME } from "@calcom/lib/constants";+import { APP_NAME, COMPANY_NAME, EMAIL_FROM_NAME } from "@calcom/lib/constants";import { renderEmail } from "../";import BaseEmail from "./_base-email";@@ -27,7 +27,7 @@ export default class ChangeOfEmailVerifyEmail extends BaseEmail {protected async getNodeMailerPayload(): Promise<Record<string, unknown>> {return {to: `${this.changeEvent.user.name} <${this.changeEvent.user.emailTo}>`,- from: `${APP_NAME} <${this.getMailerOptions().from}>`,+ from: `${EMAIL_FROM_NAME} <${this.getMailerOptions().from}>`,subject: this.changeEvent.language("change_of_email", {appName: APP_NAME,}),diff --git a/packages/emails/templates/disabled-app-email.ts b/packages/emails/templates/disabled-app-email.tsindex cd85295448e..85c75bbd614 100644--- a/packages/emails/templates/disabled-app-email.ts+++ b/packages/emails/templates/disabled-app-email.ts@@ -1,6 +1,6 @@import type { TFunction } from "next-i18next";-import { APP_NAME } from "@calcom/lib/constants";+import { EMAIL_FROM_NAME } from "@calcom/lib/constants";import { renderEmail } from "..";import BaseEmail from "./_base-email";@@ -32,7 +32,7 @@ export default class DisabledAppEmail extends BaseEmail {protected async getNodeMailerPayload(): Promise<Record<string, unknown>> {return {- from: `${APP_NAME} <${this.getMailerOptions().from}>`,+ from: `${EMAIL_FROM_NAME} <${this.getMailerOptions().from}>`,to: this.email,subject:this.title && this.eventTypeIddiff --git a/packages/emails/templates/feedback-email.ts b/packages/emails/templates/feedback-email.tsindex 4eef2a9f340..591a3807180 100644--- a/packages/emails/templates/feedback-email.ts+++ b/packages/emails/templates/feedback-email.ts@@ -1,4 +1,4 @@-import { APP_NAME } from "@calcom/lib/constants";+import { EMAIL_FROM_NAME } from "@calcom/lib/constants";import { renderEmail } from "../";import BaseEmail from "./_base-email";@@ -20,7 +20,7 @@ export default class FeedbackEmail extends BaseEmail {protected async getNodeMailerPayload(): Promise<Record<string, unknown>> {return {- from: `${APP_NAME} <${this.getMailerOptions().from}>`,+ from: `${EMAIL_FROM_NAME} <${this.getMailerOptions().from}>`,to: process.env.SEND_FEEDBACK_EMAIL,subject: `User Feedback`,html: await renderEmail("FeedbackEmail", this.feedback),diff --git a/packages/emails/templates/forgot-password-email.ts b/packages/emails/templates/forgot-password-email.tsindex 7f041693b71..2fde8e3baf0 100644--- a/packages/emails/templates/forgot-password-email.ts+++ b/packages/emails/templates/forgot-password-email.ts@@ -1,6 +1,6 @@import type { TFunction } from "next-i18next";-import { APP_NAME } from "@calcom/lib/constants";+import { APP_NAME, EMAIL_FROM_NAME } from "@calcom/lib/constants";import { renderEmail } from "../";import BaseEmail from "./_base-email";@@ -26,7 +26,7 @@ export default class ForgotPasswordEmail extends BaseEmail {protected async getNodeMailerPayload(): Promise<Record<string, unknown>> {return {to: `${this.passwordEvent.user.name} <${this.passwordEvent.user.email}>`,- from: `${APP_NAME} <${this.getMailerOptions().from}>`,+ from: `${EMAIL_FROM_NAME} <${this.getMailerOptions().from}>`,subject: this.passwordEvent.language("reset_password_subject", {appName: APP_NAME,}),diff --git a/packages/emails/templates/monthly-digest-email.ts b/packages/emails/templates/monthly-digest-email.tsindex 629b389329c..2eaaf4d27a1 100644--- a/packages/emails/templates/monthly-digest-email.ts+++ b/packages/emails/templates/monthly-digest-email.ts@@ -1,4 +1,4 @@-import { APP_NAME } from "@calcom/lib/constants";+import { APP_NAME, EMAIL_FROM_NAME } from "@calcom/lib/constants";import { renderEmail } from "../";import type { MonthlyDigestEmailData } from "../src/templates/MonthlyDigestEmail";@@ -14,7 +14,7 @@ export default class MonthlyDigestEmail extends BaseEmail {protected async getNodeMailerPayload(): Promise<Record<string, unknown>> {return {- from: `${APP_NAME} <${this.getMailerOptions().from}>`,+ from: `${EMAIL_FROM_NAME} <${this.getMailerOptions().from}>`,to: this.eventData.admin.email,subject: `${APP_NAME}: Your monthly digest`,html: await renderEmail("MonthlyDigestEmail", this.eventData),diff --git a/packages/emails/templates/org-auto-join-invite.ts b/packages/emails/templates/org-auto-join-invite.tsindex 64a2811ec66..c295eca9d87 100644--- a/packages/emails/templates/org-auto-join-invite.ts+++ b/packages/emails/templates/org-auto-join-invite.ts@@ -1,6 +1,6 @@import type { TFunction } from "next-i18next";-import { APP_NAME } from "@calcom/lib/constants";+import { APP_NAME, EMAIL_FROM_NAME } from "@calcom/lib/constants";import { renderEmail } from "..";import BaseEmail from "./_base-email";@@ -25,7 +25,7 @@ export default class OrgAutoJoinEmail extends BaseEmail {protected async getNodeMailerPayload(): Promise<Record<string, unknown>> {return {to: this.orgAutoInviteEvent.to,- from: `${APP_NAME} <${this.getMailerOptions().from}>`,+ from: `${EMAIL_FROM_NAME} <${this.getMailerOptions().from}>`,subject: this.orgAutoInviteEvent.language("user_invited_you", {user: this.orgAutoInviteEvent.from,team: this.orgAutoInviteEvent.orgName,diff --git a/packages/emails/templates/organization-admin-no-slots-email.ts b/packages/emails/templates/organization-admin-no-slots-email.tsindex a99b48daff9..e929b2fc508 100644--- a/packages/emails/templates/organization-admin-no-slots-email.ts+++ b/packages/emails/templates/organization-admin-no-slots-email.ts@@ -1,6 +1,6 @@import type { TFunction } from "next-i18next";-import { APP_NAME } from "@calcom/lib/constants";+import { EMAIL_FROM_NAME } from "@calcom/lib/constants";import renderEmail from "../src/renderEmail";import BaseEmail from "./_base-email";@@ -27,7 +27,7 @@ export default class OrganizationAdminNoSlotsEmail extends BaseEmail {protected async getNodeMailerPayload(): Promise<Record<string, unknown>> {return {- from: `${APP_NAME} <${this.getMailerOptions().from}>`,+ from: `${EMAIL_FROM_NAME} <${this.getMailerOptions().from}>`,to: this.adminNoSlots.to.email,subject: this.adminNoSlots.language("org_admin_no_slots|subject", { name: this.adminNoSlots.user }),html: await renderEmail("OrganizationAdminNoSlotsEmail", this.adminNoSlots),diff --git a/packages/emails/templates/organization-creation-email.ts b/packages/emails/templates/organization-creation-email.tsindex c6d5de4b449..c6adc774302 100644--- a/packages/emails/templates/organization-creation-email.ts+++ b/packages/emails/templates/organization-creation-email.ts@@ -1,6 +1,6 @@import type { TFunction } from "next-i18next";-import { APP_NAME } from "@calcom/lib/constants";+import { EMAIL_FROM_NAME } from "@calcom/lib/constants";import { renderEmail } from "../";import BaseEmail from "./_base-email";@@ -29,7 +29,7 @@ export default class OrganizationCreationEmail extends BaseEmail {protected async getNodeMailerPayload(): Promise<Record<string, unknown>> {return {to: this.organizationCreationEvent.to,- from: `${APP_NAME} <${this.getMailerOptions().from}>`,+ from: `${EMAIL_FROM_NAME} <${this.getMailerOptions().from}>`,subject: this.organizationCreationEvent.language(`email_organization_created|subject`),html: await renderEmail("OrganizationCreationEmail", this.organizationCreationEvent),text: "",diff --git a/packages/emails/templates/organization-email-verification.ts b/packages/emails/templates/organization-email-verification.tsindex 89cfec56f48..0722662477e 100644--- a/packages/emails/templates/organization-email-verification.ts+++ b/packages/emails/templates/organization-email-verification.ts@@ -1,6 +1,6 @@import type { TFunction } from "next-i18next";-import { APP_NAME } from "@calcom/lib/constants";+import { EMAIL_FROM_NAME } from "@calcom/lib/constants";import renderEmail from "../src/renderEmail";import BaseEmail from "./_base-email";@@ -24,7 +24,7 @@ export default class OrganizationEmailVerification extends BaseEmail {protected async getNodeMailerPayload(): Promise<Record<string, unknown>> {return {- from: `${APP_NAME} <${this.getMailerOptions().from}>`,+ from: `${EMAIL_FROM_NAME} <${this.getMailerOptions().from}>`,to: this.orgVerifyInput.user.email,subject: this.orgVerifyInput.language("verify_email_organization"),html: await renderEmail("OrganisationAccountVerifyEmail", this.orgVerifyInput),diff --git a/packages/emails/templates/organizer-attendee-cancelled-seat-email.ts b/packages/emails/templates/organizer-attendee-cancelled-seat-email.tsindex 5fa17765b1b..86246335f58 100644--- a/packages/emails/templates/organizer-attendee-cancelled-seat-email.ts+++ b/packages/emails/templates/organizer-attendee-cancelled-seat-email.ts@@ -1,4 +1,4 @@-import { APP_NAME } from "@calcom/lib/constants";+import { EMAIL_FROM_NAME } from "@calcom/lib/constants";import { renderEmail } from "../";import OrganizerScheduledEmail from "./organizer-scheduled-email";@@ -16,7 +16,7 @@ export default class OrganizerCancelledEmail extends OrganizerScheduledEmail {}return {- from: `${APP_NAME} <${this.getMailerOptions().from}>`,+ from: `${EMAIL_FROM_NAME} <${this.getMailerOptions().from}>`,to: toAddresses.join(","),subject: `${this.t("event_cancelled_subject", {title: this.calEvent.title,diff --git a/packages/emails/templates/organizer-cancelled-email.ts b/packages/emails/templates/organizer-cancelled-email.tsindex 3466cab5c2e..8b3597ca6a4 100644--- a/packages/emails/templates/organizer-cancelled-email.ts+++ b/packages/emails/templates/organizer-cancelled-email.ts@@ -1,4 +1,4 @@-import { APP_NAME } from "@calcom/lib/constants";+import { EMAIL_FROM_NAME } from "@calcom/lib/constants";import { renderEmail } from "../";import generateIcsString from "../lib/generateIcsString";@@ -20,7 +20,7 @@ export default class OrganizerCancelledEmail extends OrganizerScheduledEmail {}),method: "REQUEST",},- from: `${APP_NAME} <${this.getMailerOptions().from}>`,+ from: `${EMAIL_FROM_NAME} <${this.getMailerOptions().from}>`,to: toAddresses.join(","),subject: `${this.t("event_cancelled_subject", {title: this.calEvent.title,diff --git a/packages/emails/templates/organizer-daily-video-download-recording-email.ts b/packages/emails/templates/organizer-daily-video-download-recording-email.tsindex 34e1549132b..6aeba56175d 100644--- a/packages/emails/templates/organizer-daily-video-download-recording-email.ts+++ b/packages/emails/templates/organizer-daily-video-download-recording-email.ts@@ -1,6 +1,6 @@import type { TFunction } from "next-i18next";-import { APP_NAME } from "@calcom/lib/constants";+import { EMAIL_FROM_NAME } from "@calcom/lib/constants";import { TimeFormat } from "@calcom/lib/timeFormat";import type { CalendarEvent } from "@calcom/types/Calendar";@@ -22,7 +22,7 @@ export default class OrganizerDailyVideoDownloadRecordingEmail extends BaseEmailprotected async getNodeMailerPayload(): Promise<Record<string, unknown>> {return {to: `${this.calEvent.organizer.email}>`,- from: `${APP_NAME} <${this.getMailerOptions().from}>`,+ from: `${EMAIL_FROM_NAME} <${this.getMailerOptions().from}>`,replyTo: [...this.calEvent.attendees.map(({ email }) => email), this.calEvent.organizer.email],subject: `${this.t("download_recording_subject", {title: this.calEvent.title,diff --git a/packages/emails/templates/organizer-daily-video-download-transcript-email.ts b/packages/emails/templates/organizer-daily-video-download-transcript-email.tsindex a491ecf278d..058b48d954b 100644--- a/packages/emails/templates/organizer-daily-video-download-transcript-email.ts+++ b/packages/emails/templates/organizer-daily-video-download-transcript-email.ts@@ -1,6 +1,6 @@import type { TFunction } from "next-i18next";-import { APP_NAME } from "@calcom/lib/constants";+import { EMAIL_FROM_NAME } from "@calcom/lib/constants";import { TimeFormat } from "@calcom/lib/timeFormat";import type { CalendarEvent } from "@calcom/types/Calendar";@@ -22,7 +22,7 @@ export default class OrganizerDailyVideoDownloadTranscriptEmail extends BaseEmaiprotected async getNodeMailerPayload(): Promise<Record<string, unknown>> {return {to: `${this.calEvent.organizer.email}>`,- from: `${APP_NAME} <${this.getMailerOptions().from}>`,+ from: `${EMAIL_FROM_NAME} <${this.getMailerOptions().from}>`,replyTo: [...this.calEvent.attendees.map(({ email }) => email), this.calEvent.organizer.email],subject: `${this.t("download_transcript_email_subject", {title: this.calEvent.title,diff --git a/packages/emails/templates/organizer-location-change-email.ts b/packages/emails/templates/organizer-location-change-email.tsindex c5c8e893c09..9cfd14a544e 100644--- a/packages/emails/templates/organizer-location-change-email.ts+++ b/packages/emails/templates/organizer-location-change-email.ts@@ -1,4 +1,4 @@-import { APP_NAME } from "@calcom/lib/constants";+import { EMAIL_FROM_NAME } from "@calcom/lib/constants";import { renderEmail } from "../";import generateIcsString from "../lib/generateIcsString";@@ -20,7 +20,7 @@ export default class OrganizerLocationChangeEmail extends OrganizerScheduledEmai}),method: "REQUEST",},- from: `${APP_NAME} <${this.getMailerOptions().from}>`,+ from: `${EMAIL_FROM_NAME} <${this.getMailerOptions().from}>`,to: toAddresses.join(","),replyTo: [this.calEvent.organizer.email, ...this.calEvent.attendees.map(({ email }) => email)],subject: `${this.t("location_changed_event_type_subject", {diff --git a/packages/emails/templates/organizer-payment-refund-failed-email.ts b/packages/emails/templates/organizer-payment-refund-failed-email.tsindex fd907ba1b52..5100e4f8f28 100644--- a/packages/emails/templates/organizer-payment-refund-failed-email.ts+++ b/packages/emails/templates/organizer-payment-refund-failed-email.ts@@ -1,4 +1,4 @@-import { APP_NAME } from "@calcom/lib/constants";+import { EMAIL_FROM_NAME } from "@calcom/lib/constants";import { renderEmail } from "../";import OrganizerScheduledEmail from "./organizer-scheduled-email";@@ -8,7 +8,7 @@ export default class OrganizerPaymentRefundFailedEmail extends OrganizerScheduleconst toAddresses = [this.teamMember?.email || this.calEvent.organizer.email];return {- from: `${APP_NAME} <${this.getMailerOptions().from}>`,+ from: `${EMAIL_FROM_NAME} <${this.getMailerOptions().from}>`,to: toAddresses.join(","),subject: `${this.t("refund_failed_subject", {eventType: this.calEvent.type,diff --git a/packages/emails/templates/organizer-request-email.ts b/packages/emails/templates/organizer-request-email.tsindex 47b82627f57..d4f3feb372a 100644--- a/packages/emails/templates/organizer-request-email.ts+++ b/packages/emails/templates/organizer-request-email.ts@@ -1,4 +1,4 @@-import { APP_NAME } from "@calcom/lib/constants";+import { EMAIL_FROM_NAME } from "@calcom/lib/constants";import { renderEmail } from "../";import OrganizerScheduledEmail from "./organizer-scheduled-email";@@ -8,7 +8,7 @@ export default class OrganizerRequestEmail extends OrganizerScheduledEmail {const toAddresses = [this.teamMember?.email || this.calEvent.organizer.email];return {- from: `${APP_NAME} <${this.getMailerOptions().from}>`,+ from: `${EMAIL_FROM_NAME} <${this.getMailerOptions().from}>`,to: toAddresses.join(","),replyTo: [this.calEvent.organizer.email, ...this.calEvent.attendees.map(({ email }) => email)],subject: `${this.t("awaiting_approval")}: ${this.calEvent.title}`,diff --git a/packages/emails/templates/organizer-request-reminder-email.ts b/packages/emails/templates/organizer-request-reminder-email.tsindex b8d5130a7ac..8b28d49bbab 100644--- a/packages/emails/templates/organizer-request-reminder-email.ts+++ b/packages/emails/templates/organizer-request-reminder-email.ts@@ -1,4 +1,4 @@-import { APP_NAME } from "@calcom/lib/constants";+import { EMAIL_FROM_NAME } from "@calcom/lib/constants";import { renderEmail } from "../";import OrganizerRequestEmail from "./organizer-request-email";@@ -8,7 +8,7 @@ export default class OrganizerRequestReminderEmail extends OrganizerRequestEmailconst toAddresses = [this.teamMember?.email || this.calEvent.organizer.email];return {- from: `${APP_NAME} <${this.getMailerOptions().from}>`,+ from: `${EMAIL_FROM_NAME} <${this.getMailerOptions().from}>`,to: toAddresses.join(","),replyTo: [this.calEvent.organizer.email, ...this.calEvent.attendees.map(({ email }) => email)],subject: `${this.t("event_awaiting_approval_subject", {diff --git a/packages/emails/templates/organizer-requested-to-reschedule-email.ts b/packages/emails/templates/organizer-requested-to-reschedule-email.tsindex 8a5e5247b75..3c62aa6f027 100644--- a/packages/emails/templates/organizer-requested-to-reschedule-email.ts+++ b/packages/emails/templates/organizer-requested-to-reschedule-email.ts@@ -3,7 +3,7 @@ import { createEvent } from "ics";import dayjs from "@calcom/dayjs";import { getRichDescription } from "@calcom/lib/CalEventParser";-import { APP_NAME } from "@calcom/lib/constants";+import { EMAIL_FROM_NAME } from "@calcom/lib/constants";import type { CalendarEvent } from "@calcom/types/Calendar";import { renderEmail } from "..";@@ -35,7 +35,7 @@ export default class OrganizerRequestedToRescheduleEmail extends OrganizerSchedu}),method: "REQUEST",},- from: `${APP_NAME} <${this.getMailerOptions().from}>`,+ from: `${EMAIL_FROM_NAME} <${this.getMailerOptions().from}>`,to: toAddresses.join(","),subject: `${this.t("rescheduled_event_type_subject", {eventType: this.calEvent.type,diff --git a/packages/emails/templates/organizer-rescheduled-email.ts b/packages/emails/templates/organizer-rescheduled-email.tsindex ed63aa8fcc2..3b7013ac342 100644--- a/packages/emails/templates/organizer-rescheduled-email.ts+++ b/packages/emails/templates/organizer-rescheduled-email.ts@@ -1,4 +1,4 @@-import { APP_NAME } from "@calcom/lib/constants";+import { EMAIL_FROM_NAME } from "@calcom/lib/constants";import { renderEmail } from "../";import generateIcsString from "../lib/generateIcsString";@@ -20,7 +20,7 @@ export default class OrganizerRescheduledEmail extends OrganizerScheduledEmail {}),method: "REQUEST",},- from: `${APP_NAME} <${this.getMailerOptions().from}>`,+ from: `${EMAIL_FROM_NAME} <${this.getMailerOptions().from}>`,to: toAddresses.join(","),replyTo: [this.calEvent.organizer.email, ...this.calEvent.attendees.map(({ email }) => email)],subject: `${this.calEvent.organizer.language.translate("event_type_has_been_rescheduled_on_time_date", {diff --git a/packages/emails/templates/organizer-scheduled-email.ts b/packages/emails/templates/organizer-scheduled-email.tsindex 5e8e27f283b..347345704de 100644--- a/packages/emails/templates/organizer-scheduled-email.ts+++ b/packages/emails/templates/organizer-scheduled-email.ts@@ -3,7 +3,7 @@ import { cloneDeep } from "lodash";import type { TFunction } from "next-i18next";import { getRichDescription } from "@calcom/lib/CalEventParser";-import { APP_NAME } from "@calcom/lib/constants";+import { EMAIL_FROM_NAME } from "@calcom/lib/constants";import { TimeFormat } from "@calcom/lib/timeFormat";import type { CalendarEvent, Person } from "@calcom/types/Calendar";@@ -44,7 +44,7 @@ export default class OrganizerScheduledEmail extends BaseEmail {}),method: "REQUEST",},- from: `${APP_NAME} <${this.getMailerOptions().from}>`,+ from: `${EMAIL_FROM_NAME} <${this.getMailerOptions().from}>`,to: toAddresses.join(","),replyTo: [this.calEvent.organizer.email, ...this.calEvent.attendees.map(({ email }) => email)],subject: `${this.newSeat ? `${this.t("new_attendee")}: ` : ""}${this.calEvent.title}`,diff --git a/packages/emails/templates/slug-replacement-email.ts b/packages/emails/templates/slug-replacement-email.tsindex e7943300db8..90133beee2b 100644--- a/packages/emails/templates/slug-replacement-email.ts+++ b/packages/emails/templates/slug-replacement-email.ts@@ -1,6 +1,6 @@import type { TFunction } from "next-i18next";-import { APP_NAME } from "@calcom/lib/constants";+import { EMAIL_FROM_NAME } from "@calcom/lib/constants";import { renderEmail } from "..";import BaseEmail from "./_base-email";@@ -23,7 +23,7 @@ export default class SlugReplacementEmail extends BaseEmail {protected async getNodeMailerPayload(): Promise<Record<string, unknown>> {return {- from: `${APP_NAME} <${this.getMailerOptions().from}>`,+ from: `${EMAIL_FROM_NAME} <${this.getMailerOptions().from}>`,to: this.email,subject: this.t("email_subject_slug_replacement", { slug: this.slug }),html: await renderEmail("SlugReplacementEmail", {diff --git a/packages/emails/templates/team-invite-email.ts b/packages/emails/templates/team-invite-email.tsindex 339e2e38c78..145a4b44e20 100644--- a/packages/emails/templates/team-invite-email.ts+++ b/packages/emails/templates/team-invite-email.ts@@ -1,6 +1,6 @@import type { TFunction } from "next-i18next";-import { APP_NAME } from "@calcom/lib/constants";+import { APP_NAME, EMAIL_FROM_NAME } from "@calcom/lib/constants";import { renderEmail } from "../";import BaseEmail from "./_base-email";@@ -72,7 +72,7 @@ export default class TeamInviteEmail extends BaseEmail {protected async getNodeMailerPayload(): Promise<Record<string, unknown>> {return {to: this.teamInviteEvent.to,- from: `${APP_NAME} <${this.getMailerOptions().from}>`,+ from: `${EMAIL_FROM_NAME} <${this.getMailerOptions().from}>`,subject: getSubject(this.teamInviteEvent),html: await renderEmail("TeamInviteEmail", this.teamInviteEvent),text: "",diff --git a/packages/lib/constants.ts b/packages/lib/constants.tsindex 5deb46ea7c6..2da6880fbf7 100644--- a/packages/lib/constants.ts+++ b/packages/lib/constants.ts@@ -28,6 +28,7 @@ export const SUPPORT_MAIL_ADDRESS = process.env.NEXT_PUBLIC_SUPPORT_MAIL_ADDRESSexport const COMPANY_NAME = process.env.NEXT_PUBLIC_COMPANY_NAME || "Cal.com, Inc.";export const SENDER_ID = process.env.NEXT_PUBLIC_SENDER_ID || "Cal";export const SENDER_NAME = process.env.NEXT_PUBLIC_SENDGRID_SENDER_NAME || "Cal.com";+export const EMAIL_FROM_NAME = process.env.EMAIL_FROM_NAME || APP_NAME;// This is the URL from which all Cal Links and their assets are served.// Use website URL to make links shorter(cal.com and not app.cal.com)diff --git a/packages/types/environment.d.ts b/packages/types/environment.d.tsindex caee8827917..9706f44b08e 100644--- a/packages/types/environment.d.ts+++ b/packages/types/environment.d.ts@@ -17,6 +17,7 @@ declare namespace NodeJS {readonly ZOOM_CLIENT_ID: string | undefined;readonly ZOOM_CLIENT_SECRET: string | undefined;readonly EMAIL_FROM: string | undefined;+ readonly EMAIL_FROM_NAME: string | undefined;readonly EMAIL_SERVER_HOST: string | undefined;readonly EMAIL_SERVER_PORT: string | undefined;readonly EMAIL_SERVER_USER: string | undefined;diff --git a/turbo.json b/turbo.jsonindex 0433b1f8c4c..91cd8b5f7e2 100644--- a/turbo.json+++ b/turbo.json@@ -278,6 +278,7 @@"E2E_TEST_SAML_ADMIN_EMAIL","E2E_TEST_SAML_ADMIN_PASSWORD","EMAIL_FROM",+ "EMAIL_FROM_NAME","EMAIL_SERVER_HOST","EMAIL_SERVER_PASSWORD","EMAIL_SERVER_PORT",