fix: sms formatting (#18647)

This commit is contained in:
Udit Takkar
2025-03-18 16:59:13 -03:00
committed by GitHub
parent 40333c81c5
commit d5d90a8b87
9 changed files with 98 additions and 32 deletions
+11 -4
View File
@@ -10,11 +10,18 @@ export default class AwaitingPaymentSMS extends SMSManager {
getMessage(attendee: Person) {
const t = attendee.language.translate;
return `${t("meeting_awaiting_payment")}: ${t("complete_your_booking_subject", {
const messageText = `${t("meeting_awaiting_payment")}: ${t("complete_your_booking_subject", {
title: this.calEvent.title,
date: this.getFormattedDate(attendee.timeZone, attendee.language.locale),
})}. \n\n ${t("you_can_view_booking_details_with_this_url", {
url: `${this.calEvent.bookerUrl ?? WEBAPP_URL}/booking/${this.calEvent.uid}?changes=true`,
})} `;
})}`;
const bookingUrl = `${this.calEvent.bookerUrl ?? WEBAPP_URL}/booking/${this.calEvent.uid}?changes=true`;
const urlText = t("you_can_view_booking_details_with_this_url", {
url: bookingUrl,
});
return `${messageText}\n\n${urlText}`;
}
}
+6 -2
View File
@@ -8,11 +8,15 @@ export default class CancelledSeatSMS extends SMSManager {
}
getMessage(attendee: Person) {
return `${attendee.language.translate("no_longer_attending", {
const t = attendee.language.translate;
const messageText = `${t("no_longer_attending", {
name: attendee.name,
})}. \n\n${attendee.language.translate("event_no_longer_attending_subject", {
})}\n\n${t("event_no_longer_attending_subject", {
name: this.calEvent.team?.name || this.calEvent.organizer.name,
date: this.getFormattedDate(attendee.timeZone, attendee.language.locale),
})} `;
return `${messageText}`;
}
}
+10 -4
View File
@@ -10,14 +10,20 @@ export default class EventCancelledSMS extends SMSManager {
getMessage(attendee: Person) {
const t = attendee.language.translate;
return `${t("hey_there")} ${attendee.name}, ${t("event_request_cancelled")}/n/n ${t(
const bookingUrl = `${this.calEvent.bookerUrl ?? WEBAPP_URL}/booking/${this.calEvent.uid}`;
const messageText = `${t("hey_there")} ${attendee.name}, ${t("event_request_cancelled")}\n\n${t(
"event_cancelled_subject",
{
title: this.calEvent.title,
date: this.getFormattedDate(attendee.timeZone, attendee.language.locale),
}
)}. /n/n ${t("visit_cancelled_booking")} ${this.calEvent.bookerUrl ?? WEBAPP_URL}/booking/${
this.calEvent.uid
} `;
)}`;
const urlText = t("you_can_view_booking_details_with_this_url", {
url: bookingUrl,
});
return `${messageText}\n\n${urlText}`;
}
}
+9 -2
View File
@@ -9,9 +9,16 @@ export default class EventDeclinedSMS extends SMSManager {
getMessage(attendee: Person) {
const t = attendee.language.translate;
return `${t("hey_there")} ${attendee.name}, ${t("event_request_declined")} ${t("event_declined_subject", {
const eventDeclinedText = t("event_declined_subject", {
title: this.calEvent.title,
date: this.getFormattedDate(attendee.timeZone, attendee.language.locale),
})}`;
});
const messageText = `${t("hey_there")} ${attendee.name}, ${t(
"event_request_declined"
)} ${eventDeclinedText}`;
return messageText;
}
}
@@ -10,8 +10,15 @@ export default class EventLocationChangedSMS extends SMSManager {
getMessage(attendee: Person) {
const t = attendee.language.translate;
return `${t("event_location_changed")}. \n\n ${t("you_can_view_booking_details_with_this_url", {
url: `${this.calEvent.bookerUrl ?? WEBAPP_URL}/booking/${this.calEvent.uid}?changes=true`,
})}`;
const messageText = `${t("event_location_changed")}`;
const bookingUrl = `${this.calEvent.bookerUrl ?? WEBAPP_URL}/booking/${this.calEvent.uid}?changes=true`;
const urlText = t("you_can_view_booking_details_with_this_url", {
url: bookingUrl,
});
return `${messageText}\n\n${urlText}`;
}
}
+15 -5
View File
@@ -10,12 +10,22 @@ export default class EventRequestSMS extends SMSManager {
getMessage(attendee: Person) {
const t = attendee.language.translate;
return `${t("booking_submitted", {
const bookingSubmittedText = t("booking_submitted", {
name: attendee.name,
})}. ${t("user_needs_to_confirm_or_reject_booking", {
});
const bookingUrl = `${this.calEvent.bookerUrl ?? WEBAPP_URL}/booking/${this.calEvent.uid}`;
const urlText = t("you_can_view_booking_details_with_this_url", {
url: bookingUrl,
});
const userNeedsToConfirmOrRejectBookingText = t("user_needs_to_confirm_or_reject_booking", {
user: this.calEvent.organizer.name,
})}\n\n ${t("you_can_view_booking_details_with_this_url", {
url: `${this.calEvent.bookerUrl ?? WEBAPP_URL}/booking/${this.calEvent.uid}`,
})}`;
});
const messageText = `${bookingSubmittedText}. ${userNeedsToConfirmOrRejectBookingText}\n\n${urlText}`;
return messageText;
}
}
@@ -10,10 +10,18 @@ export default class EventRequestToRescheduleSMS extends SMSManager {
getMessage(attendee: Person) {
const t = attendee.language.translate;
return `${t("request_reschedule_booking")}: ${t("request_reschedule_subtitle", {
const bookingUrl = `${this.calEvent.bookerUrl ?? WEBAPP_URL}/booking/${this.calEvent.uid}?changes=true`;
const requestRescheduleSubtitle = t("request_reschedule_subtitle", {
organizer: this.calEvent.organizer.name,
})} \n\n${t("need_to_reschedule_or_cancel")} ${this.calEvent.bookerUrl ?? WEBAPP_URL}/booking/${
this.calEvent.uid
}?changes=true`;
});
const needToRescheduleOrCancelText = t("need_to_reschedule_or_cancel");
const messageText = `${needToRescheduleOrCancelText}: ${requestRescheduleSubtitle} \n\n${t(
"need_to_reschedule_or_cancel"
)} ${bookingUrl}`;
return messageText;
}
}
+14 -4
View File
@@ -10,11 +10,21 @@ export default class EventSuccessfullyReScheduledSMS extends SMSManager {
getMessage(attendee: Person) {
const t = attendee.language.translate;
return `${t("hey_there")} ${attendee.name}, ${t("event_type_has_been_rescheduled_on_time_date", {
const bookerUrl = `${this.calEvent.bookerUrl ?? WEBAPP_URL}/booking/${this.calEvent.uid}`;
const bookerUrlText = t("you_can_view_booking_details_with_this_url", {
url: bookerUrl,
});
const eventTypeHasBeenRescheduledOnTimeDateText = t("event_type_has_been_rescheduled_on_time_date", {
title: this.calEvent.title,
date: this.getFormattedDate(attendee.timeZone, attendee.language.locale),
})} \n\n ${t("you_can_view_booking_details_with_this_url", {
url: `${this.calEvent.bookerUrl ?? WEBAPP_URL}/booking/${this.calEvent.uid}`,
})}`;
});
const messageText = `${t("hey_there")} ${
attendee.name
}, ${eventTypeHasBeenRescheduledOnTimeDateText} \n\n${bookerUrlText}`;
return messageText;
}
}
+11 -4
View File
@@ -10,11 +10,18 @@ export default class EventSuccessfullyScheduledSMS extends SMSManager {
getMessage(attendee: Person) {
const t = attendee.language.translate;
return `${t("confirming_your_booking_sms", {
const confirmationText = t("confirming_your_booking_sms", {
name: attendee.name,
date: this.getFormattedDate(attendee.timeZone, attendee.language.locale),
})} \n\n ${t("you_can_view_booking_details_with_this_url", {
url: `${this.calEvent.bookerUrl ?? WEBAPP_URL}/booking/${this.calEvent.uid}`,
})}`;
});
const bookingUrl = `${this.calEvent.bookerUrl ?? WEBAPP_URL}/booking/${this.calEvent.uid}`;
const urlText = t("you_can_view_booking_details_with_this_url", {
url: bookingUrl,
});
return `${confirmationText}\n\n${urlText}`;
}
}