fix: wrap escalation email in try/catch
This commit is contained in:
@@ -149,6 +149,7 @@ async function runEscalation(interaction, ticket, nextTier, reason) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (!isDiscordTicket && ticket.gmailThreadId) {
|
if (!isDiscordTicket && ticket.gmailThreadId) {
|
||||||
|
try {
|
||||||
const emailBody = CONFIG.ESCALATION_MESSAGE.replace(/\{support_name\}/g, CONFIG.SUPPORT_NAME) + (reason ? `\n\nReason: ${reason}` : '');
|
const emailBody = CONFIG.ESCALATION_MESSAGE.replace(/\{support_name\}/g, CONFIG.SUPPORT_NAME) + (reason ? `\n\nReason: ${reason}` : '');
|
||||||
await sendTicketNotificationEmail(
|
await sendTicketNotificationEmail(
|
||||||
ticket,
|
ticket,
|
||||||
@@ -156,6 +157,9 @@ async function runEscalation(interaction, ticket, nextTier, reason) {
|
|||||||
emailBody,
|
emailBody,
|
||||||
interaction.member?.displayName || interaction.user.username
|
interaction.member?.displayName || interaction.user.username
|
||||||
);
|
);
|
||||||
|
} catch (emailErr) {
|
||||||
|
console.error('Escalation email failed (non-fatal):', emailErr.message);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nextTier === 2 && ticket.welcomeMessageId) {
|
if (nextTier === 2 && ticket.welcomeMessageId) {
|
||||||
|
|||||||
Reference in New Issue
Block a user