Skip to content

Commit

Permalink
Merge pull request #1862 from bcgov/hotfix/ALCS-2255
Browse files Browse the repository at this point in the history
Create branching header for notifications
  • Loading branch information
trslater authored Sep 18, 2024
2 parents d0998a0 + 13218d1 commit a411d41
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 7 deletions.
3 changes: 2 additions & 1 deletion services/templates/emails/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ import { footer } from './partials/footer.template';
export const build = (
content: string,
includeButton: boolean = true,
isNotification: boolean = false,
): string => `
${header}
${header(isNotification)}
${content}
${includeButton ? portalButton : ''}
${footer}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,5 @@ export const template = build(
Attachment: {{fileName}}
</p>`,
false,
true,
);
4 changes: 2 additions & 2 deletions services/templates/emails/partials/header.template.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { masthead } from './masthead.template';

export const header = `
export const header = (isNotification: boolean = false) => `
<!DOCTYPE html>
<html lang="en">
<head>
Expand All @@ -14,5 +14,5 @@ export const header = `
<![endif]-->
<div style="max-width: 600px; margin: 0 auto; padding-top: 40px; font-family: Helvetica, Arial, sans-serif;">
${masthead}
${masthead(isNotification)}
`;
20 changes: 16 additions & 4 deletions services/templates/emails/partials/masthead.template.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,24 @@
import * as config from 'config';

export const masthead = `
const defaultDetails = `
<p style="font-size: 21px;"><b>{{ parentTypeLabel }} ID #{{ fileNumber }}</b></p>
<p>Name: <b>{{ applicantName }}</b></p>
<p>Status: <b>{{ status }}</b></p>
`;

const notificationDetails = `
<p style="font-size: 21px;"><b>{{ parentTypeLabel }} ID #SRW{{ fileNumber }}</b></p>
<p>Primary Contact: <b>{{ contactName }}</b></p>
<p>Status: <b>{{ status }}</b></p>
<p>{{ dateSubmitted }}</p>
<p>Submitter's File Number: {{ submittersFileNumber }}</p>
`;

export const masthead = (isNotification: boolean = false) => `
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td style="width: 400px; vertical-align: top;" align="left" vertical-align:top>
<p style="font-size: 21px;"><b>{{ parentTypeLabel }} ID #{{ fileNumber }}</b></p>
<p>Name: <b>{{ applicantName }}</b></p>
<p>Status: <b>{{ status }}</b></p>
${isNotification ? notificationDetails : defaultDetails}
</td>
<td style="width: 200px; vertical-align: top;" align="right">
<table border="0" cellpadding="0" cellspacing="0">
Expand Down

0 comments on commit a411d41

Please sign in to comment.