/** * Source-of-truth: project-task-assigned-primary email template. * * Uses the shared email layout wrapper. Body content is built from * per-language translated strings so that only text differs between locales. * * Based on the modern styling from migration 20251217211644. */ const { wrapEmailLayout } = require('../../_shared/emailLayout.cjs'); const { BADGE_BG, BRAND_DARK, BRAND_PRIMARY, INFO_BOX_BG, INFO_BOX_BORDER, } = require('../../_shared/constants.cjs'); const TEMPLATE_NAME = 'project-task-assigned-primary'; const SUBTYPE_NAME = 'Project Task Assigned'; const SUBJECTS = { en: 'You have been assigned to task: {{task.name}}', fr: 'Vous avez \u00e9t\u00e9 assign\u00e9 \u00e0 la t\u00e2che : {{task.name}}', es: 'Te han asignado a la tarea: {{task.name}}', de: 'Sie wurden der Aufgabe zugewiesen: {{task.name}}', nl: 'U bent toegewezen aan de taak: {{task.name}}', it: 'Ti \u00e8 stata assegnata la task: {{task.name}}', pl: 'Zosta\u0142e\u015b przypisany do zadania: {{task.name}}', }; /* eslint-disable max-len */ const COPY = { en: { headerLabel: 'Task Assignment', intro: 'Hello{{#if recipientName}} {{recipientName}}{{/if}}, you have been assigned as the primary resource for a project task.', assignedBadge: 'Primary Assignee', badgeBg: BADGE_BG, badgeColor: BRAND_DARK, taskLabel: 'Task', projectLabel: 'Project', dueDateLabel: 'Due Date', assignedByLabel: 'Assigned By', roleLabel: 'Role', descriptionTitle: 'Description', viewButton: 'View Task', buttonColor: BRAND_PRIMARY, footer: 'Powered by Alga PSA', textHeader: 'Task Assignment', textIntro: 'You have been assigned as the Primary Assignee for this task:', textView: 'View task at', }, fr: { headerLabel: 'Assignation de t\u00e2che', intro: 'Bonjour{{#if recipientName}} {{recipientName}}{{/if}}, vous avez \u00e9t\u00e9 assign\u00e9 comme ressource principale pour une t\u00e2che de projet.', assignedBadge: 'Responsable principal', badgeBg: BADGE_BG, badgeColor: BRAND_DARK, taskLabel: 'T\u00e2che', projectLabel: 'Projet', dueDateLabel: 'Date d\'\u00e9ch\u00e9ance', assignedByLabel: 'Assign\u00e9 par', roleLabel: 'R\u00f4le', descriptionTitle: 'Description', viewButton: 'Voir la t\u00e2che', buttonColor: BRAND_PRIMARY, footer: 'Powered by Alga PSA', textHeader: 'Assignation de t\u00e2che', textIntro: 'Vous avez \u00e9t\u00e9 assign\u00e9 comme responsable principal pour cette t\u00e2che :', textView: 'Voir la t\u00e2che sur', }, es: { headerLabel: 'Asignaci\u00f3n de tarea', intro: 'Hola{{#if recipientName}} {{recipientName}}{{/if}}, te han asignado como recurso principal para una tarea del proyecto.', assignedBadge: 'Responsable principal', badgeBg: BADGE_BG, badgeColor: BRAND_DARK, taskLabel: 'Tarea', projectLabel: 'Proyecto', dueDateLabel: 'Fecha de vencimiento', assignedByLabel: 'Asignado por', roleLabel: 'Rol', descriptionTitle: 'Descripci\u00f3n', viewButton: 'Ver tarea', buttonColor: BRAND_PRIMARY, footer: 'Powered by Alga PSA', textHeader: 'Asignaci\u00f3n de tarea', textIntro: 'Te han asignado como responsable principal de esta tarea:', textView: 'Ver tarea en', }, de: { headerLabel: 'Aufgabenzuweisung', intro: 'Hallo{{#if recipientName}} {{recipientName}}{{/if}}, Sie wurden als Hauptverantwortlicher f\u00fcr eine Projektaufgabe zugewiesen.', assignedBadge: 'Hauptverantwortlicher', badgeBg: BADGE_BG, badgeColor: BRAND_DARK, taskLabel: 'Aufgabe', projectLabel: 'Projekt', dueDateLabel: 'F\u00e4lligkeitsdatum', assignedByLabel: 'Zugewiesen von', roleLabel: 'Rolle', descriptionTitle: 'Beschreibung', viewButton: 'Aufgabe anzeigen', buttonColor: BRAND_PRIMARY, footer: 'Powered by Alga PSA', textHeader: 'Aufgabenzuweisung', textIntro: 'Sie wurden als Hauptverantwortlicher f\u00fcr diese Aufgabe zugewiesen:', textView: 'Aufgabe anzeigen unter', }, nl: { headerLabel: 'Taaktoewijzing', intro: 'Hallo{{#if recipientName}} {{recipientName}}{{/if}}, u bent toegewezen als hoofdverantwoordelijke voor een projecttaak.', assignedBadge: 'Hoofdverantwoordelijke', badgeBg: BADGE_BG, badgeColor: BRAND_DARK, taskLabel: 'Taak', projectLabel: 'Project', dueDateLabel: 'Vervaldatum', assignedByLabel: 'Toegewezen door', roleLabel: 'Rol', descriptionTitle: 'Beschrijving', viewButton: 'Taak bekijken', buttonColor: BRAND_PRIMARY, footer: 'Powered by Alga PSA', textHeader: 'Taaktoewijzing', textIntro: 'U bent toegewezen als hoofdverantwoordelijke voor deze taak:', textView: 'Taak bekijken op', }, it: { headerLabel: 'Assegnazione task', intro: 'Ciao{{#if recipientName}} {{recipientName}}{{/if}}, ti \u00e8 stata assegnata la responsabilit\u00e0 principale per una task di progetto.', assignedBadge: 'Responsabile principale', badgeBg: BADGE_BG, badgeColor: BRAND_DARK, taskLabel: 'Task', projectLabel: 'Progetto', dueDateLabel: 'Data di scadenza', assignedByLabel: 'Assegnato da', roleLabel: 'Ruolo', descriptionTitle: 'Descrizione', viewButton: 'Visualizza task', buttonColor: BRAND_PRIMARY, footer: 'Powered by Alga PSA', textHeader: 'Assegnazione task', textIntro: 'Ti \u00e8 stata assegnata la responsabilit\u00e0 principale per questa task:', textView: 'Visualizza task su', }, pl: { headerLabel: 'Przypisanie zadania', intro: 'Witaj{{#if recipientName}} {{recipientName}}{{/if}}, zosta\u0142e\u015b przypisany jako g\u0142\u00f3wny wykonawca zadania projektowego.', assignedBadge: 'G\u0142\u00f3wny wykonawca', badgeBg: BADGE_BG, badgeColor: BRAND_DARK, taskLabel: 'Zadanie', projectLabel: 'Projekt', dueDateLabel: 'Termin', assignedByLabel: 'Przypisa\u0142(a)', roleLabel: 'Rola', descriptionTitle: 'Opis', viewButton: 'Zobacz zadanie', buttonColor: BRAND_PRIMARY, footer: 'Powered by Alga PSA', textHeader: 'Przypisanie zadania', textIntro: 'Zosta\u0142e\u015b przypisany jako g\u0142\u00f3wny wykonawca tego zadania:', textView: 'Zobacz zadanie pod adresem', }, }; /* eslint-enable max-len */ function buildBodyHtml(c) { return `
${c.intro}
| ${c.taskLabel} | {{task.name}} |
| ${c.projectLabel} | {{task.project}} |
| ${c.dueDateLabel} | {{task.dueDate}} |
| ${c.assignedByLabel} | {{task.assignedBy}} |
| ${c.roleLabel} | {{task.role}} |