refactor: replace action_link with corresponding link variables in notification templates

This commit is contained in:
Simon Larsen
2025-10-06 18:25:59 +01:00
parent 7368a0eb7c
commit b7a0dbf81b
27 changed files with 9 additions and 40 deletions

View File

@@ -1202,7 +1202,6 @@ ${createdItem.description?.trim() || "No description provided."}
templateVariables: {
monitor_name: monitor.name!,
probe_status: enabledStatus,
action_link: vars["monitorViewLink"] || "",
monitor_link: vars["monitorViewLink"] || "",
},
});
@@ -1323,7 +1322,6 @@ ${createdItem.description?.trim() || "No description provided."}
templateVariables: {
monitor_name: monitor.name!,
probe_status: status,
action_link: vars["monitorViewLink"] || "",
monitor_link: vars["monitorViewLink"] || "",
},
});

View File

@@ -148,7 +148,6 @@ export class Service extends DatabaseService<Model> {
createdModel.onCallDutyPolicy?.name || "No name provided",
schedule_name: scheduleName,
on_call_context: `schedule ${scheduleName}`,
action_link: vars["onCallPolicyViewLink"] || "",
policy_link: vars["onCallPolicyViewLink"] || "",
},
});
@@ -346,7 +345,6 @@ export class Service extends DatabaseService<Model> {
deletedItem.onCallDutyPolicy?.name || "No name provided",
schedule_name: scheduleName,
on_call_context: `schedule ${scheduleName}`,
action_link: vars["onCallPolicyViewLink"] || "",
policy_link: vars["onCallPolicyViewLink"] || "",
},
});

View File

@@ -146,7 +146,6 @@ export class Service extends DatabaseService<Model> {
on_call_policy_name:
createdModel.onCallDutyPolicy?.name || "No name provided",
on_call_context: `team ${temaName}`,
action_link: vars["onCallPolicyViewLink"] || "",
policy_link: vars["onCallPolicyViewLink"] || "",
},
});
@@ -349,7 +348,6 @@ export class Service extends DatabaseService<Model> {
on_call_policy_name:
deletedItem.onCallDutyPolicy?.name || "No name provided",
on_call_context: `team ${teamName}`,
action_link: vars["onCallPolicyViewLink"] || "",
policy_link: vars["onCallPolicyViewLink"] || "",
},
});

View File

@@ -129,7 +129,6 @@ export class Service extends DatabaseService<Model> {
on_call_policy_name:
createdModel.onCallDutyPolicy?.name || "No name provided",
on_call_context: `escalation rule ${createdModel.onCallDutyPolicyEscalationRule?.name || "No name provided"}`,
action_link: vars["onCallPolicyViewLink"] || "",
policy_link: vars["onCallPolicyViewLink"] || "",
},
});
@@ -349,7 +348,6 @@ export class Service extends DatabaseService<Model> {
on_call_policy_name:
deletedItem.onCallDutyPolicy?.name || "No name provided",
on_call_context: `escalation rule ${deletedItem.onCallDutyPolicyEscalationRule?.name || "No name provided"}`,
action_link: vars["onCallPolicyViewLink"] || "",
policy_link: vars["onCallPolicyViewLink"] || "",
},
});

View File

@@ -276,7 +276,6 @@ export class Service extends DatabaseService<OnCallDutyPolicySchedule> {
templateVariables: {
on_call_policy_name: onCallPolicy.name!,
schedule_name: onCallSchedule.name!,
action_link: vars["onCallPolicyViewLink"] || "",
schedule_link: vars["onCallPolicyViewLink"] || "",
},
});
@@ -410,7 +409,6 @@ export class Service extends DatabaseService<OnCallDutyPolicySchedule> {
templateVariables: {
on_call_policy_name: onCallPolicy.name!,
schedule_name: onCallSchedule.name!,
action_link: vars["onCallPolicyViewLink"] || "",
schedule_link: vars["onCallPolicyViewLink"] || "",
},
});
@@ -564,7 +562,6 @@ export class Service extends DatabaseService<OnCallDutyPolicySchedule> {
templateVariables: {
on_call_policy_name: onCallPolicy.name!,
schedule_name: onCallSchedule.name!,
action_link: vars["onCallPolicyViewLink"] || "",
schedule_link: vars["onCallPolicyViewLink"] || "",
},
});

View File

@@ -398,7 +398,6 @@ export class Service extends DatabaseService<Model> {
templateVariables: {
probe_name: probe.name!,
probe_status: connectionStatus,
action_link: vars["viewProbesLink"] || "",
probe_link: vars["viewProbesLink"] || "",
},
});

View File

@@ -37,9 +37,9 @@ const templateDashboardLinkVariableMap: Partial<
[WhatsAppTemplateIds.ScheduledMaintenanceStateChangedOwnerNotification]:
"maintenance_link",
[WhatsAppTemplateIds.StatusPageAnnouncementCreatedOwnerNotification]:
"status_link",
[WhatsAppTemplateIds.StatusPageCreatedOwnerNotification]: "status_link",
[WhatsAppTemplateIds.StatusPageOwnerAddedNotification]: "status_link",
"status_page_link",
[WhatsAppTemplateIds.StatusPageCreatedOwnerNotification]: "status_page_link",
[WhatsAppTemplateIds.StatusPageOwnerAddedNotification]: "status_page_link",
[WhatsAppTemplateIds.ProbeStatusChangedOwnerNotification]: "probe_link",
[WhatsAppTemplateIds.ProbeOwnerAddedNotification]: "probe_link",
[WhatsAppTemplateIds.OnCallUserIsOnRosterNotification]: "schedule_link",

View File

@@ -118,9 +118,9 @@ const rawWhatsAppTemplateMessages: WhatsAppTemplateMessagesDefinition = {
[WhatsAppTemplateIds.ScheduledMaintenanceNotePostedOwnerNotification]: `A new note was posted on scheduled maintenance {{event_title}}. Review the event using {{maintenance_link}} on the OneUptime dashboard for the latest updates.`,
[WhatsAppTemplateIds.ScheduledMaintenanceOwnerAddedNotification]: `You have been added as an owner of scheduled maintenance {{event_title}}. Manage the event using {{maintenance_link}} on the OneUptime dashboard to stay ready.`,
[WhatsAppTemplateIds.ScheduledMaintenanceStateChangedOwnerNotification]: `Scheduled maintenance {{event_title}} state changed to {{event_state}}. Track event status using {{maintenance_link}} on the OneUptime dashboard to stay aligned.`,
[WhatsAppTemplateIds.StatusPageAnnouncementCreatedOwnerNotification]: `Announcement {{announcement_title}} was published on status page {{status_page_name}}. View the announcement using {{status_link}} on the OneUptime dashboard for more information.`,
[WhatsAppTemplateIds.StatusPageCreatedOwnerNotification]: `Status page {{status_page_name}} has been created. View status page details using {{status_link}} on the OneUptime dashboard for full context.`,
[WhatsAppTemplateIds.StatusPageOwnerAddedNotification]: `You have been added as an owner of status page {{status_page_name}}. Manage the status page using {{status_link}} on the OneUptime dashboard to stay engaged.`,
[WhatsAppTemplateIds.StatusPageAnnouncementCreatedOwnerNotification]: `Announcement {{announcement_title}} was published on status page {{status_page_name}}. View the announcement using {{status_page_link}} on the OneUptime dashboard for more information.`,
[WhatsAppTemplateIds.StatusPageCreatedOwnerNotification]: `Status page {{status_page_name}} has been created. View status page details using {{status_page_link}} on the OneUptime dashboard for full context.`,
[WhatsAppTemplateIds.StatusPageOwnerAddedNotification]: `You have been added as an owner of status page {{status_page_name}}. Manage the status page using {{status_page_link}} on the OneUptime dashboard to stay engaged.`,
[WhatsAppTemplateIds.ProbeStatusChangedOwnerNotification]: `Probe {{probe_name}} status is {{probe_status}}. Review the probe using {{probe_link}} on the OneUptime dashboard for specifics.`,
[WhatsAppTemplateIds.ProbeOwnerAddedNotification]: `You have been added as an owner of probe {{probe_name}}. Manage the probe using {{probe_link}} on the OneUptime dashboard to take action.`,
[WhatsAppTemplateIds.OnCallUserIsOnRosterNotification]: `You are now on-call for policy {{on_call_policy_name}} on schedule {{schedule_name}}. View the on-call schedule using {{schedule_link}} on the OneUptime dashboard to plan ahead.`,

View File

@@ -204,7 +204,6 @@ RunCron(
templateVariables: {
alert_title: alert.title!,
project_name: alert.project!.name!,
action_link: vars["alertViewLink"] || "",
alert_link: vars["alertViewLink"] || "",
alert_number: alertNumber.toString(),
},

View File

@@ -196,7 +196,6 @@ RunCron(
eventType,
templateVariables: {
alert_title: alert.title!,
action_link: vars["alertViewLink"] || "",
alert_link: vars["alertViewLink"] || "",
alert_number:
alert.alertNumber !== undefined

View File

@@ -226,7 +226,6 @@ RunCron(
eventType,
templateVariables: {
alert_title: alert.title!,
action_link: vars["alertViewLink"] || "",
alert_link: vars["alertViewLink"] || "",
alert_number:
alert.alertNumber !== undefined

View File

@@ -217,7 +217,6 @@ RunCron(
templateVariables: {
alert_title: alert.title!,
alert_state: alertState!.name!,
action_link: vars["alertViewLink"] || "",
alert_link: vars["alertViewLink"] || "",
alert_number:
alert.alertNumber !== undefined

View File

@@ -216,7 +216,6 @@ Notification sent to owners because [Incident ${incidentNumber}](${(await Incide
templateVariables: {
incident_title: incident.title!,
project_name: incident.project!.name!,
action_link: vars["incidentViewLink"] || "",
incident_link: vars["incidentViewLink"] || "",
incident_number: incidentNumber.toString(),
},

View File

@@ -233,7 +233,6 @@ RunCron(
eventType,
templateVariables: {
incident_title: incident.title!,
action_link: vars["incidentViewLink"] || "",
incident_number:
incident.incidentNumber !== undefined
? incident.incidentNumber.toString()

View File

@@ -232,7 +232,6 @@ RunCron(
eventType,
templateVariables: {
incident_title: incident.title!,
action_link: vars["incidentViewLink"] || "",
incident_number:
incident.incidentNumber !== undefined
? incident.incidentNumber.toString()

View File

@@ -230,7 +230,6 @@ RunCron(
templateVariables: {
incident_title: incident.title!,
incident_state: incidentState!.name!,
action_link: vars["incidentViewLink"] || "",
incident_number:
incident.incidentNumber !== undefined
? incident.incidentNumber.toString()

View File

@@ -127,7 +127,6 @@ RunCron(
eventType,
templateVariables: {
monitor_name: monitor.name!,
action_link: vars["monitorViewLink"] || "",
monitor_link: vars["monitorViewLink"] || "",
},
});

View File

@@ -212,7 +212,6 @@ RunCron(
eventType,
templateVariables: {
monitor_name: monitor.name!,
action_link: vars["monitorViewLink"] || "",
monitor_link: vars["monitorViewLink"] || "",
},
});

View File

@@ -164,7 +164,6 @@ RunCron(
templateVariables: {
monitor_name: monitor.name || "Monitor",
monitor_status: monitorStatus!.name!,
action_link: vars["monitorViewLink"] || "",
monitor_link: vars["monitorViewLink"] || "",
},
});

View File

@@ -198,7 +198,6 @@ RunCron(
eventType,
templateVariables: {
probe_name: probe.name!,
action_link: vars["viewProbeLink"] || "",
probe_link: vars["viewProbeLink"] || "",
},
});

View File

@@ -150,7 +150,6 @@ RunCron(
eventType,
templateVariables: {
event_title: scheduledMaintenance.title!,
action_link: vars["scheduledMaintenanceViewLink"] || "",
maintenance_link: vars["scheduledMaintenanceViewLink"] || "",
},
});

View File

@@ -218,7 +218,6 @@ RunCron(
eventType,
templateVariables: {
event_title: scheduledMaintenance.title!,
action_link: vars["scheduledMaintenanceViewLink"] || "",
maintenance_link: vars["scheduledMaintenanceViewLink"] || "",
},
});

View File

@@ -236,7 +236,6 @@ RunCron(
eventType,
templateVariables: {
event_title: scheduledMaintenance.title!,
action_link: vars["scheduledMaintenanceViewLink"] || "",
maintenance_link: vars["scheduledMaintenanceViewLink"] || "",
},
});

View File

@@ -179,7 +179,6 @@ RunCron(
templateVariables: {
event_title: scheduledMaintenance.title!,
event_state: scheduledMaintenanceState!.name!,
action_link: vars["scheduledMaintenanceViewLink"] || "",
maintenance_link: vars["scheduledMaintenanceViewLink"] || "",
},
});

View File

@@ -138,8 +138,7 @@ RunCron(
templateVariables: {
status_page_name: statusPage.name!,
announcement_title: announcement.title!,
action_link: statusPageLink || "",
status_link: statusPageLink || "",
status_page_link: statusPageLink || "",
},
});

View File

@@ -133,8 +133,7 @@ RunCron(
eventType,
templateVariables: {
status_page_name: statusPage.name!,
action_link: vars["statusPageViewLink"] || "",
status_link: vars["statusPageViewLink"] || "",
status_page_link: vars["statusPageViewLink"] || "",
},
});

View File

@@ -214,8 +214,7 @@ RunCron(
eventType,
templateVariables: {
status_page_name: statusPage.name!,
action_link: vars["statusPageViewLink"] || "",
status_link: vars["statusPageViewLink"] || "",
status_page_link: vars["statusPageViewLink"] || "",
},
});