cal/packages/emails/templates/attendee-request-email.ts
Joe Au-Yeung 8b07b839e9
Fix - add team members to emails (#7207)
* On booking add team members & translation

* Add team members to round robin create

* Only update calendars on reschedule if there is a calendar reference

* Send email on reschedules

* Send team email on cancelled event

* Add team members to calendar event description

* Clean up

* Convert other emails to organizer & teams

* Type check fixes

* More type fixes

* Change organizer scheduled input to an object

* early return updateCalendarEvent

* Introduce team member type

* Fix type errors

* Put team members before attendees

* Remove lodash cloneDeep

* Update packages/core/EventManager.ts

Co-authored-by: Omar López <zomars@me.com>

* Remove booking select object

* Revert "Remove booking select object"

This reverts commit 9f121ff4eb.

* Refactor email manager (#7270)

Co-authored-by: zomars <zomars@me.com>

* Type change

* Remove conditional check for updateAllCalendarEvents

---------

Co-authored-by: zomars <zomars@me.com>
2023-02-27 13:45:40 -07:00

32 lines
1.1 KiB
TypeScript

import { APP_NAME } from "@calcom/lib/constants";
import { renderEmail } from "../";
import AttendeeScheduledEmail from "./attendee-scheduled-email";
export default class AttendeeRequestEmail extends AttendeeScheduledEmail {
protected getNodeMailerPayload(): Record<string, unknown> {
const toAddresses = this.calEvent.attendees.map((attendee) => attendee.email);
return {
from: `${APP_NAME} <${this.getMailerOptions().from}>`,
to: toAddresses.join(","),
subject: `${this.calEvent.attendees[0].language.translate("booking_submitted_subject", {
title: this.calEvent.title,
date: this.getFormattedDate(),
})}`,
html: renderEmail("AttendeeRequestEmail", {
calEvent: this.calEvent,
attendee: this.attendee,
}),
text: this.getTextBody(
this.calEvent.attendees[0].language.translate("booking_submitted", {
name: this.calEvent.attendees[0].name,
}),
this.calEvent.attendees[0].language.translate("user_needs_to_confirm_or_reject_booking", {
user: this.calEvent.organizer.name,
})
),
};
}
}