feat: add attendee first name and last name tokens to workflows (#10509)

This commit is contained in:
Monto 2023-08-03 18:10:59 +03:00 committed by GitHub
parent 91af873db9
commit 669065cebd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 26 additions and 1 deletions

View File

@ -1976,5 +1976,9 @@
"org_admin_other_teams_description": "Here you can see teams inside your organization but that you are not part of. You can add yourself to them if needed.",
"no_other_teams_found": "No other teams found",
"no_other_teams_found_description": "There are no other teams in this organization.",
"attendee_first_name_variable": "Attendee first name",
"attendee_last_name_variable": "Attendee last name",
"attendee_first_name_info": "The person booking's first name",
"attendee_last_name_info": "The person booking's last name",
"ADD_NEW_STRINGS_ABOVE_THIS_LINE_TO_PREVENT_MERGE_CONFLICTS": "↑↑↑↑↑↑↑↑↑↑↑↑↑ Add your new strings above here ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑"
}

View File

@ -866,6 +866,8 @@ async function handler(
{
email: bookerEmail,
name: fullName,
firstName: (typeof bookerName === "object" && bookerName.firstName) || "",
lastName: (typeof bookerName === "object" && bookerName.lastName) || "",
timeZone: reqBody.timeZone,
language: { translate: tAttendees, locale: language ?? "en" },
},
@ -879,6 +881,8 @@ async function handler(
guestArray.push({
email: guest,
name: "",
firstName: "",
lastName: "",
timeZone: reqBody.timeZone,
language: { translate: tGuests, locale: "en" },
});

View File

@ -46,6 +46,8 @@ export const DYNAMIC_TEXT_VARIABLES = [
"location",
"organizer_name",
"attendee_name",
"attendee_first_name",
"attendee_last_name",
"attendee_email",
"additional_notes",
"meeting_url",

View File

@ -105,6 +105,8 @@ export const scheduleEmailReminder = async (
eventName: evt.title || "",
organizerName: evt.organizer.name,
attendeeName: evt.attendees[0].name,
attendeeFirstName: evt.attendees[0].firstName,
attendeeLastName: evt.attendees[0].lastName,
attendeeEmail: evt.attendees[0].email,
eventDate: dayjs(startTime).tz(timeZone),
eventEndTime: dayjs(endTime).tz(timeZone),

View File

@ -24,7 +24,14 @@ const log = logger.getChildLogger({ prefix: ["[smsReminderManager]"] });
export type BookingInfo = {
uid?: string | null;
attendees: { name: string; email: string; timeZone: string; language: { locale: string } }[];
attendees: {
name: string;
firstName?: string;
lastName?: string;
email: string;
timeZone: string;
language: { locale: string };
}[];
organizer: {
language: { locale: string };
name: string;
@ -107,6 +114,8 @@ export const scheduleSMSReminder = async (
eventName: evt.title,
organizerName: evt.organizer.name,
attendeeName: evt.attendees[0].name,
attendeeFirstName: evt.attendees[0].firstName,
attendeeLastName: evt.attendees[0].lastName,
attendeeEmail: evt.attendees[0].email,
eventDate: dayjs(evt.startTime).tz(timeZone),
eventEndTime: dayjs(evt.endTime).tz(timeZone),

View File

@ -9,6 +9,8 @@ export type VariablesType = {
eventName?: string;
organizerName?: string;
attendeeName?: string;
attendeeFirstName?: string;
attendeeLastName?: string;
attendeeEmail?: string;
eventDate?: Dayjs;
eventEndTime?: Dayjs;
@ -52,6 +54,8 @@ const customTemplate = (
.replaceAll("{ATTENDEE}", variables.attendeeName || "")
.replaceAll("{ORGANIZER_NAME}", variables.organizerName || "") //old variable names
.replaceAll("{ATTENDEE_NAME}", variables.attendeeName || "") //old variable names
.replaceAll("{ATTENDEE_FIRST_NAME}", variables.attendeeFirstName || "")
.replaceAll("{ATTENDEE_LAST_NAME}", variables.attendeeLastName || "")
.replaceAll("{EVENT_DATE}", translatedDate)
.replaceAll("{EVENT_TIME}", variables.eventDate?.format(currentTimeFormat) || "")
.replaceAll("{START_TIME}", variables.eventDate?.format(currentTimeFormat) || "")