diff --git a/src/core/email/templates/project-step-changed.template.tsx b/src/core/email/templates/project-step-changed.template.tsx index 9a08cd4543..26274fda94 100644 --- a/src/core/email/templates/project-step-changed.template.tsx +++ b/src/core/email/templates/project-step-changed.template.tsx @@ -1,3 +1,4 @@ +import { cleanJoin } from '@seedcompany/common'; import { Button, Column, @@ -5,8 +6,11 @@ import { Section, Text, } from '@seedcompany/nestjs-email/templates'; -import { startCase } from 'lodash'; import { EmailNotification as StepChangeNotification } from '../../../components/project'; +import { + ProjectStep as Step, + ProjectType as Type, +} from '../../../components/project/dto'; import { EmailTemplate, Heading } from './base'; import { FormattedDateTime } from './formatted-date-time'; import { useFrontendUrl } from './frontend-url'; @@ -21,18 +25,22 @@ export function ProjectStepChanged({ }: StepChangeNotification) { const projectUrl = useFrontendUrl(`/projects/${project.id}`); const projectName = project.name.value; + const projectType = Type.entry(project.type); + const oldStep = oldStepVal ? Step.entry(oldStepVal).label : undefined; + const newStep = project.step.value + ? Step.entry(project.step.value).label + : undefined; - const oldStep = startCase(oldStepVal) || undefined; - const newStep = startCase(project.step.value) || undefined; + const isMultiplication = projectType.value === Type.MultiplicationTranslation; + const title = cleanJoin(' - ', [ + isMultiplication && projectType.label, + projectName ?? 'Project', + isMultiplication && primaryPartnerName, + newStep ? `is ${newStep}` : 'Status Change', + ]); return ( - + {projectName && newStep ? ( <> @@ -64,12 +72,6 @@ export function ProjectStepChanged({ value={project.modifiedAt} timezone={recipient.timezone.value} /> -
- Project Type: {project.type} -
- {primaryPartnerName ? ( - <>Primary Partner: {primaryPartnerName} - ) : null}