fix: team event emails; sending & email subject (#10289)
This commit is contained in:
parent
3818093652
commit
5b280b2188
|
@ -7,6 +7,7 @@ export type EventNameObjectType = {
|
||||||
attendeeName: string;
|
attendeeName: string;
|
||||||
eventType: string;
|
eventType: string;
|
||||||
eventName?: string | null;
|
eventName?: string | null;
|
||||||
|
teamName?: string | null;
|
||||||
host: string;
|
host: string;
|
||||||
location?: string;
|
location?: string;
|
||||||
bookingFields?: Prisma.JsonObject;
|
bookingFields?: Prisma.JsonObject;
|
||||||
|
@ -17,7 +18,7 @@ export function getEventName(eventNameObj: EventNameObjectType, forAttendeeView
|
||||||
if (!eventNameObj.eventName)
|
if (!eventNameObj.eventName)
|
||||||
return eventNameObj.t("event_between_users", {
|
return eventNameObj.t("event_between_users", {
|
||||||
eventName: eventNameObj.eventType,
|
eventName: eventNameObj.eventType,
|
||||||
host: eventNameObj.host,
|
host: eventNameObj.teamName || eventNameObj.host,
|
||||||
attendeeName: eventNameObj.attendeeName,
|
attendeeName: eventNameObj.attendeeName,
|
||||||
interpolation: {
|
interpolation: {
|
||||||
escapeValue: false,
|
escapeValue: false,
|
||||||
|
|
|
@ -70,16 +70,7 @@ export default class OrganizerScheduledEmail extends BaseEmail {
|
||||||
|
|
||||||
protected getNodeMailerPayload(): Record<string, unknown> {
|
protected getNodeMailerPayload(): Record<string, unknown> {
|
||||||
const clonedCalEvent = cloneDeep(this.calEvent);
|
const clonedCalEvent = cloneDeep(this.calEvent);
|
||||||
|
const toAddresses = [this.teamMember?.email || this.calEvent.organizer.email];
|
||||||
const toAddresses = [this.calEvent.organizer.email];
|
|
||||||
if (this.calEvent.team) {
|
|
||||||
this.calEvent.team.members.forEach((member) => {
|
|
||||||
const memberAttendee = this.calEvent.attendees.find((attendee) => attendee.email === member.email);
|
|
||||||
if (memberAttendee) {
|
|
||||||
toAddresses.push(memberAttendee.email);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
icalEvent: {
|
icalEvent: {
|
||||||
|
|
|
@ -997,6 +997,8 @@ async function handler(
|
||||||
attendeeName: fullName || "Nameless",
|
attendeeName: fullName || "Nameless",
|
||||||
eventType: eventType.title,
|
eventType: eventType.title,
|
||||||
eventName: eventType.eventName,
|
eventName: eventType.eventName,
|
||||||
|
// we send on behalf of team if >1 round robin attendee | collective
|
||||||
|
teamName: eventType.schedulingType === "COLLECTIVE" || users.length > 1 ? eventType.team?.name : null,
|
||||||
// TODO: Can we have an unnamed organizer? If not, I would really like to throw an error here.
|
// TODO: Can we have an unnamed organizer? If not, I would really like to throw an error here.
|
||||||
host: organizerUser.name || "Nameless",
|
host: organizerUser.name || "Nameless",
|
||||||
location: bookingLocation,
|
location: bookingLocation,
|
||||||
|
|
|
@ -43,7 +43,6 @@ const user: User & { credentials: Credential[] } = {
|
||||||
locale: "en",
|
locale: "en",
|
||||||
email: "john.doe@example.com",
|
email: "john.doe@example.com",
|
||||||
name: "John doe",
|
name: "John doe",
|
||||||
avatar: "",
|
|
||||||
destinationCalendar: null,
|
destinationCalendar: null,
|
||||||
hideBranding: true,
|
hideBranding: true,
|
||||||
brandColor: "#797979",
|
brandColor: "#797979",
|
||||||
|
|
|
@ -40,7 +40,6 @@ export const userSelect = Prisma.validator<Prisma.UserArgs>()({
|
||||||
allowDynamicBooking: true,
|
allowDynamicBooking: true,
|
||||||
destinationCalendar: true,
|
destinationCalendar: true,
|
||||||
locale: true,
|
locale: true,
|
||||||
avatar: true,
|
|
||||||
hideBranding: true,
|
hideBranding: true,
|
||||||
theme: true,
|
theme: true,
|
||||||
brandColor: true,
|
brandColor: true,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user