From d48515c8e18f4956a6408691f34552543c751969 Mon Sep 17 00:00:00 2001 From: IsaiahSama Date: Fri, 23 Jan 2026 12:45:19 -0400 Subject: [PATCH 01/16] Update email template to match physical form structure --- src/email/templates/death-certificate.hbs | 465 +++++++++++----------- 1 file changed, 239 insertions(+), 226 deletions(-) diff --git a/src/email/templates/death-certificate.hbs b/src/email/templates/death-certificate.hbs index 69f0f50..06e08a7 100644 --- a/src/email/templates/death-certificate.hbs +++ b/src/email/templates/death-certificate.hbs @@ -1,7 +1,7 @@ - - - - - -
-

New Death Certificate Application

- - - - -
-

Applicant Information

- - - {{#if applicant.title}} - - - - - {{/if}} - {{#if applicant.firstName}} - - - - - {{/if}} - {{#if applicant.middleName}} - - - - - {{/if}} - {{#if applicant.lastName}} - - - - - {{/if}} - {{#if applicant.email}} - - - - - {{/if}} - {{#if applicant.telephoneNumber}} - - - - - {{/if}} - -
Title:{{#if (eq applicant.title 'mr')}}Mr{{else if - (eq applicant.title 'ms') - }}Ms{{else if - (eq applicant.title 'mrs') - }}Mrs{{else}}{{applicant.title}}{{/if}}
First Name:{{applicant.firstName}}
Middle Name:{{applicant.middleName}}
Last Name:{{applicant.lastName}}
Email:{{applicant.email}}
Telephone Number:{{applicant.telephoneNumber}}
- -

Address

- - - {{#if applicant.addressLine1}} - - - - - {{/if}} - {{#if applicant.addressLine2}} - - - - - {{/if}} - {{#if applicant.parish}} - - - - - {{/if}} - {{#if applicant.postalCode}} - - - - - {{/if}} - -
Address Line 1:{{applicant.addressLine1}}
Address Line 2:{{applicant.addressLine2}}
Parish:{{applicant.parish}}
Postal Code:{{applicant.postalCode}}
- -

Identification

- - - {{#if applicant.idNumber}} - - - - - {{/if}} - {{#if applicant.passportNumber}} - - - - - {{/if}} - -
National ID Number:{{applicant.idNumber}}
Passport Number:{{applicant.passportNumber}}
-
- - -
-

Application Details

- - - {{#if relationship}} - - - - - {{/if}} - {{#if reasonForRequest}} - - - - - {{/if}} - -
Relationship to Deceased:{{relationship}}
Reason for Request:{{reasonForRequest}}
-
- - -
-

Deceased Information

- - - {{#if deceased.firstName}} - - - - - {{/if}} - {{#if deceased.middleName}} - - - - - {{/if}} - {{#if deceased.lastName}} - - - - - {{/if}} - {{#if deceased.idNumber}} - - - - - {{/if}} - {{#if deceased.knownDateOfDeath}} - - - - - {{/if}} - {{#if deceased.dateOfDeath}} - - - - - {{/if}} - {{#if deceased.estimatedDateOfDeath}} - - - - - {{/if}} - {{#if deceased.placeOfDeath}} - - - - - {{/if}} - {{#if deceased.causeOfDeath}} - - - - - {{/if}} - -
First Name:{{deceased.firstName}}
Middle Name:{{deceased.middleName}}
Last Name:{{deceased.lastName}}
National ID Number:{{deceased.idNumber}}
Known Date of Death:{{#if - (eq deceased.knownDateOfDeath 'yes') - }}Yes{{else}}No{{/if}}
Date of Death:{{deceased.dateOfDeath}}
Estimated Date of Death:{{deceased.estimatedDateOfDeath}}
Place of Death:{{deceased.placeOfDeath}}
Cause of Death:{{deceased.causeOfDeath}}
-
- - -
-

Order Information

-
- Number of Copies Requested: - {{order.numberOfCopies}} -
-
- - - -
- - \ No newline at end of file + + + +
+

New Death Certificate Application

+ + {{!-- Declaration Details --}} +
+

Declaration

+
+ "I confirm that my information is correct and I am happy for it to be verified. I understand that false details may lead to my application being rejected, and that the Government of Barbados will keep my information confidential.", +
+

+ {{ applicant.firstName }} + {{#if applicant.middleName}} + {{ applicant.middleName }} {{/if}} {{ applicant.lastName }} +

+

{{ today }}

+
+ + +
+

Section 1: Applicant's Name and Address

+ + + {{#if applicant.title}} + + + + + {{/if}} + {{#if applicant.firstName}} + + + + + {{/if}} + {{#if applicant.middleName}} + + + + + {{/if}} + {{#if applicant.lastName}} + + + + + {{/if}} + {{#if applicant.email}} + + + + + {{/if}} + {{#if applicant.telephoneNumber}} + + + + + {{/if}} + +
Title: + {{#if (eq applicant.title 'mr')}} + Mr{{else if + (eq applicant.title 'ms') + }}Ms{{else if + (eq applicant.title 'mrs') + }}Mrs{{ else }}{{ applicant.title }}{{/if}} +
First Name:{{ applicant.firstName }}
Middle Name:{{ applicant.middleName }}
Last Name:{{ applicant.lastName }}
Email:{{ applicant.email }}
Telephone Number:{{ applicant.telephoneNumber }}
+

Address

+ + + {{#if applicant.addressLine1}} + + + + + {{/if}} + {{#if applicant.addressLine2}} + + + + + {{/if}} + {{#if applicant.parish}} + + + + + {{/if}} + {{#if applicant.postalCode}} + + + + + {{/if}} + +
Address Line 1:{{ applicant.addressLine1 }}
Address Line 2:{{ applicant.addressLine2 }}
Parish:{{ applicant.parish }}
Postal Code:{{ applicant.postalCode }}
+

Identification

+ + + {{#if applicant.idNumber}} + + + + + {{/if}} + {{#if applicant.passportNumber}} + + + + + {{/if}} + +
National ID Number:{{ applicant.idNumber }}
Passport Number:{{ applicant.passportNumber }}
+
+ +
+

Section 2: Relationship to the Person Named on the Certificate

+ + + {{#if relationship}} + + + + + {{/if}} + {{#if reasonForRequest}} + + + + + {{/if}} + + + + + {{#if deceased.causeOfDeath}} + + + + + {{/if}} + +
Relationship to Deceased:{{ relationship }}
Reason for Request:{{ reasonForRequest }}
Number of Copies Requested{{ order.numberOfCopies }}
Cause of Death:{{ deceased.causeOfDeath }}
+
+ +
+

Section 3: Details of Death Certificate Required

+ + + {{#if deceased.lastName}} + + + + + {{/if}} + {{#if deceased.firstName}} + + + + + {{/if}} + {{#if deceased.middleName}} + + + + + {{/if}} + {{#if deceased.knownDateOfDeath}} + + + + + {{/if}} + {{#if deceased.dateOfDeath}} + + + + + {{/if}} + {{#if deceased.estimatedDateOfDeath}} + + + + + {{/if}} + {{#if deceased.idNumber}} + + + + + {{/if}} + {{#if deceased.placeOfDeath}} + + + + + {{/if}} + +
Last Name:{{ deceased.lastName }}
First Name:{{ deceased.firstName }}
Middle Name(s):{{ deceased.middleName }}
Known Date of Death: + {{#if + (eq deceased.knownDateOfDeath 'yes') + }} + Yes{{ else }}No{{/if}} +
Date of Death:{{ deceased.dateOfDeath }}
Estimated Date of Death:{{ deceased.estimatedDateOfDeath }}
National ID Number:{{ deceased.idNumber }}
Place of Death:{{ deceased.placeOfDeath }}
+
+ + +
+ + From ae90f5db0b74d7f9ef5b75f745e1595f4eecc4fe Mon Sep 17 00:00:00 2001 From: IsaiahSama Date: Fri, 23 Jan 2026 16:15:59 -0400 Subject: [PATCH 02/16] Added helper to get current date when sending an email --- src/email/email.service.ts | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/src/email/email.service.ts b/src/email/email.service.ts index 1bdcbbc..a61c287 100644 --- a/src/email/email.service.ts +++ b/src/email/email.service.ts @@ -57,49 +57,54 @@ export class EmailService { private registerHandlebarsHelpers(): void { // Equality helper - Handlebars.registerHelper('eq', function (a, b) { + Handlebars.registerHelper('eq', function(a, b) { return a === b; }); // Not equal helper - Handlebars.registerHelper('ne', function (a, b) { + Handlebars.registerHelper('ne', function(a, b) { return a !== b; }); // Greater than helper - Handlebars.registerHelper('gt', function (a, b) { + Handlebars.registerHelper('gt', function(a, b) { return a > b; }); // Less than helper - Handlebars.registerHelper('lt', function (a, b) { + Handlebars.registerHelper('lt', function(a, b) { return a < b; }); // Greater than or equal helper - Handlebars.registerHelper('gte', function (a, b) { + Handlebars.registerHelper('gte', function(a, b) { return a >= b; }); // Less than or equal helper - Handlebars.registerHelper('lte', function (a, b) { + Handlebars.registerHelper('lte', function(a, b) { return a <= b; }); // Logical AND helper - Handlebars.registerHelper('and', function (...args) { + Handlebars.registerHelper('and', function(...args) { // Remove the last argument which is the options object const values = args.slice(0, -1); return values.every((val) => !!val); }); // Logical OR helper - Handlebars.registerHelper('or', function (...args) { + Handlebars.registerHelper('or', function(...args) { // Remove the last argument which is the options object const values = args.slice(0, -1); return values.some((val) => !!val); }); + Handlebars.registerHelper('today', function(...args) { + const currentDate = new Date(); + return currentDate.toDateString(); + }); + this.logger.log('Handlebars helpers registered'); } From 0a0e2effcdd3e541db0b473f56953ed9ccdd7d23 Mon Sep 17 00:00:00 2001 From: IsaiahSama Date: Mon, 26 Jan 2026 15:56:13 -0400 Subject: [PATCH 03/16] Updated structure to better match new figma design --- src/email/templates/death-certificate.hbs | 546 +++++++++++++--------- 1 file changed, 332 insertions(+), 214 deletions(-) diff --git a/src/email/templates/death-certificate.hbs b/src/email/templates/death-certificate.hbs index 06e08a7..0ed5cee 100644 --- a/src/email/templates/death-certificate.hbs +++ b/src/email/templates/death-certificate.hbs @@ -1,256 +1,374 @@ - + -
-

New Death Certificate Application

- + + From bd5a4ed3430bee149ef478484683dbe8c9c256b8 Mon Sep 17 00:00:00 2001 From: IsaiahSama Date: Tue, 27 Jan 2026 22:12:12 -0400 Subject: [PATCH 11/16] Fixed missing closing if statements --- src/email/templates/birth-certificate.hbs | 196 +++++++++++----------- 1 file changed, 100 insertions(+), 96 deletions(-) diff --git a/src/email/templates/birth-certificate.hbs b/src/email/templates/birth-certificate.hbs index b0bf56d..684a78d 100644 --- a/src/email/templates/birth-certificate.hbs +++ b/src/email/templates/birth-certificate.hbs @@ -246,14 +246,16 @@ Are you applying for your own birth certificate? {{ applyingForYourself }} - - Relationship to the person to whom the certificate relates to - - {{#if relationshipToPerson }} - {{ relationshipToPerson }} {{ else - }} {{ relationshipOtherDescription }} {{/if}} - - + {{#if (eq applyingForYourself 'no')}} + + Relationship to the person to whom the certificate relates to + + {{#if relationshipToPerson }} + {{ relationshipToPerson }} {{ else + }} {{ relationshipOtherDescription }} {{/if}} + + + {{/if}} Reason for requesting the certificate {{ reasonForOrderingCertificate }} @@ -287,104 +289,106 @@ Last name {{ person.lastName }} - {{#if person.usePassportInstead}} - {{#if person.passportNumber}} + {{/if}} + {{#if person.usePassportInstead}} + {{#if person.passportNumber}} + + Passport number + {{ person.passportNumber }} + + {{/if}} {{ else }} + {{#if person.idNumber}} + + National ID number + {{ person.idNumber }} + + {{/if}} {{/if}} + {{#if birthDetails.dateOfBirth}} + + Date of birth + {{ birthDetails.dateOfBirth }} + + {{/if}} + {{#if birthDetails.placeOfBirth}} + + Place of birth + {{ birthDetails.placeOfBirth }} + + {{/if}} + {{#if birthDetails.placeOfBaptism}} + + Place of baptism + {{ birthDetails.placeOfBaptism }} + + {{/if}} + + + + +
+

Parents' Details

+ + + {{#if parents.father}} + {{#if parents.father.firstName}} - - + + - {{/if}} {{ else }} - {{#if person.idNumber}} + {{/if}} + {{#if parents.father.middleName}} - - + + - {{/if}} {{/if}} - {{#if birthDetails.dateOfBirth}} + {{/if}} + {{#if parents.father.lastName}} + + + + + {{/if}} + {{/if}} + {{#if parents.mother}} + {{#if parents.mother.firstName}} - - + + {{/if}} - {{#if birthDetails.placeOfBirth}} + {{#if parents.mother.middleName}} - - + + {{/if}} - {{#if birthDetails.placeOfBaptism}} + {{#if parents.mother.lastName}} - - + + {{/if}} - -
Passport number{{ person.passportNumber }}Father's first name{{ parents.father.firstName }}
National ID number{{ person.idNumber }}Father's middle name(s){{ parents.father.middleName }}
Father's last name{{ parents.father.lastName }}
Date of birth{{ birthDetails.dateOfBirth }}Mother's first name{{ parents.mother.firstName }}
Place of birth{{ birthDetails.placeOfBirth }}Mother's middle name(s){{ parents.mother.middleName }}
Place of baptism{{ birthDetails.placeOfBaptism }}Mother's last name{{ parents.mother.lastName }}
-
- -
-

Parents' Details

- - - {{#if parents.father}} - {{#if parents.father.firstName}} - - - - - {{/if}} - {{#if parents.father.middleName}} - - - - - {{/if}} - {{#if parents.father.lastName}} - - - - - {{/if}} {{/if}} - {{#if parents.mother}} - {{#if - parents.mother.firstName}} - - - - - {{/if}} - {{#if parents.mother.middleName}} - - - - - {{/if}} - {{#if parents.mother.lastName}} - - - - - {{/if}} - -
Father's first name{{ parents.father.firstName }}
Father's middle name(s){{ parents.father.middleName }}
Father's last name{{ parents.father.lastName }}
Mother's first name{{ parents.mother.firstName }}
Mother's middle name(s){{ parents.mother.middleName }}
Mother's last name{{ parents.mother.lastName }}
-
- - -
- - + {{/if}} + + + + + + + + From a40f0773872f3a3978eb7705f7f0f92fca66a3da Mon Sep 17 00:00:00 2001 From: IsaiahSama Date: Tue, 27 Jan 2026 22:32:47 -0400 Subject: [PATCH 12/16] Fixed issue with incorrect if statement --- src/email/templates/marriage-certificate.hbs | 86 ++++++++++---------- 1 file changed, 43 insertions(+), 43 deletions(-) diff --git a/src/email/templates/marriage-certificate.hbs b/src/email/templates/marriage-certificate.hbs index bf5d1da..769f56c 100644 --- a/src/email/templates/marriage-certificate.hbs +++ b/src/email/templates/marriage-certificate.hbs @@ -246,7 +246,7 @@ Are you applying for your own marriage certificate? {{ applyingForYourself }} - {{#if eq applyingForYourself 'no'}} + {{#if (eq applyingForYourself 'no')}} Relationship to the person to whom the certificate relates {{ reason.relationshipToMarriedPersons }} @@ -298,45 +298,45 @@ Husband - National registration No. {{ husband.idNumber }} - {{/if}} {{ else }} - {{#if husband.passportNumber}} - - Husband - Passport number - {{ husband.passportNumber }} - - {{/if}} {{/if}} - {{#if wife.idNumber}} - - Wife - National registration No. - {{ wife.idNumber }} - - {{/if}} {{ else }} - {{#if wife.passportNumber}} - - Wife - Passport number - {{ wife.passportNumber }} - - {{/if}} {{/if}} - - - - - - - - + {{ else }} + {{#if husband.passportNumber}} + + Husband - Passport number + {{ husband.passportNumber }} + + {{/if}} {{/if}} + {{#if wife.idNumber}} + + Wife - National registration No. + {{ wife.idNumber }} + + {{ else }} + {{#if wife.passportNumber}} + + Wife - Passport number + {{ wife.passportNumber }} + + {{/if}} {{/if}} + + + + + + + + From 2fb79d33c529a3e7a89dbd66431d7a867f38aea7 Mon Sep 17 00:00:00 2001 From: IsaiahSama Date: Wed, 28 Jan 2026 16:44:30 -0400 Subject: [PATCH 13/16] Fixed issue where h2 tag was not closed --- src/email/templates/marriage-certificate.hbs | 169 +++++++++---------- 1 file changed, 84 insertions(+), 85 deletions(-) diff --git a/src/email/templates/marriage-certificate.hbs b/src/email/templates/marriage-certificate.hbs index 769f56c..e1fccc9 100644 --- a/src/email/templates/marriage-certificate.hbs +++ b/src/email/templates/marriage-certificate.hbs @@ -238,105 +238,104 @@
-

- Relationship to Person Named on the Certificate - - - - - - - {{#if (eq applyingForYourself 'no')}} - - - - - {{/if}} - - - - - - - - - -
Are you applying for your own marriage certificate?{{ applyingForYourself }}
Relationship to the person to whom the certificate relates{{ reason.relationshipToMarriedPersons }}
Reason for requesting the certificate{{ reason.explanationForRequestingCertificate }}
Number of certificates required{{ order.numberOfCopies }}
-

-
- -
-

Details of Marriage Certificate Required

+

Relationship to Person Named on the Certificate

- - - - - - - - - - + + + {{#if (eq applyingForYourself 'no')}} + + + + + {{/if}} - - + + - - + + + +
Husband – surname{{ husband.lastName }}
Husband – first name{{ husband.firstName }}
Wife (maiden) – surname{{ wife.maidenName }}Are you applying for your own marriage certificate?{{ applyingForYourself }}
Relationship to the person to whom the certificate relates{{ reason.relationshipToMarriedPersons }}
Wife – first name{{ wife.firstName }}Reason for requesting the certificate{{ reason.explanationForRequestingCertificate }}
Date of marriage{{ marriageDetails.dateOfMarriage }}Number of certificates required{{ order.numberOfCopies }}
+ +
+ +
+

Details of Marriage Certificate Required

+ + + + + + + + + + + + + + + + + + + + + + + + + + + {{#if husband.idNumber}} - - + + - {{#if husband.idNumber}} + {{ else }} + {{#if husband.passportNumber}} + + + + + {{/if}} {{/if}} + {{#if wife.idNumber}} - - + + {{ else }} - {{#if husband.passportNumber}} + {{#if wife.passportNumber}} - - + + {{/if}} {{/if}} - {{#if wife.idNumber}} - - - - - {{ else }} - {{#if wife.passportNumber}} - - - - - {{/if}} {{/if}} - -
Husband – surname{{ husband.lastName }}
Husband – first name{{ husband.firstName }}
Wife (maiden) – surname{{ wife.maidenName }}
Wife – first name{{ wife.firstName }}
Date of marriage{{ marriageDetails.dateOfMarriage }}
Place of marriage{{ marriageDetails.placeOfMarriage }}
Place of marriage{{ marriageDetails.placeOfMarriage }}Husband - National registration No.{{ husband.idNumber }}
Husband - Passport number{{ husband.passportNumber }}
Husband - National registration No.{{ husband.idNumber }}Wife - National registration No.{{ wife.idNumber }}
Husband - Passport number{{ husband.passportNumber }}Wife - Passport number{{ wife.passportNumber }}
Wife - National registration No.{{ wife.idNumber }}
Wife - Passport number{{ wife.passportNumber }}
-
- - + + + + + - - + + + From 2fae0f75d318e2c1b2f6c11be93e979a32a8c2b3 Mon Sep 17 00:00:00 2001 From: IsaiahSama Date: Wed, 28 Jan 2026 16:55:15 -0400 Subject: [PATCH 14/16] Removed unneeded message about multiple emails --- src/email/templates/birth-certificate.hbs | 112 ++++++++----------- src/email/templates/death-certificate.hbs | 22 +--- src/email/templates/marriage-certificate.hbs | 20 +--- 3 files changed, 53 insertions(+), 101 deletions(-) diff --git a/src/email/templates/birth-certificate.hbs b/src/email/templates/birth-certificate.hbs index 684a78d..b403165 100644 --- a/src/email/templates/birth-certificate.hbs +++ b/src/email/templates/birth-certificate.hbs @@ -114,29 +114,13 @@ Copies: {{ order.numberOfCopies }}

-
-

- Before you can process this request, you need 2 emails with matching - reference numbers: -

-
    -
  1. A certificate request email (this email).
  2. -
  3. - A payment confirmation email. -
    - (a separate email with the subject line: Birth certificate payment - (reference number: {{ submissionId }})) -
  4. -
-

Here is the data from this request:

-

Declaration

- "I confirm that my information is correct and I am happy for it to be + I confirm that my information is correct and I am happy for it to be verified. I understand that false details may lead to my application being rejected, and that the Government of Barbados will keep my - information confidential." + information confidential.

@@ -291,7 +275,8 @@ {{/if}} {{#if person.usePassportInstead}} - {{#if person.passportNumber}} + {{#if + person.passportNumber}} @@ -347,48 +332,47 @@ - {{/if}} - {{/if}} - {{#if parents.mother}} - {{#if parents.mother.firstName}} - - - - - {{/if}} - {{#if parents.mother.middleName}} - - - - - {{/if}} - {{#if parents.mother.lastName}} - - - - - {{/if}} - {{/if}} - -
Passport number {{ person.passportNumber }}Father's last name {{ parents.father.lastName }}
Mother's first name{{ parents.mother.firstName }}
Mother's middle name(s){{ parents.mother.middleName }}
Mother's last name{{ parents.mother.lastName }}
-
- - - - - + {{/if}} {{/if}} + {{#if parents.mother}} + {{#if + parents.mother.firstName}} + + Mother's first name + {{ parents.mother.firstName }} + + {{/if}} + {{#if parents.mother.middleName}} + + Mother's middle name(s) + {{ parents.mother.middleName }} + + {{/if}} + {{#if parents.mother.lastName}} + + Mother's last name + {{ parents.mother.lastName }} + + {{/if}} {{/if}} + + + + + + + + diff --git a/src/email/templates/death-certificate.hbs b/src/email/templates/death-certificate.hbs index be5fbba..6e78307 100644 --- a/src/email/templates/death-certificate.hbs +++ b/src/email/templates/death-certificate.hbs @@ -87,7 +87,7 @@ - + @@ -117,29 +117,13 @@ Relationship to Deceased: {{ relationshipToPerson }}

-
-

- Before you can process this request, you need 2 emails with matching - reference numbers: -

-
    -
  1. A certificate request email (this email).
  2. -
  3. - A payment confirmation email. -
    - (a separate email with the subject line: Death certificate payment - (reference number: {{ submissionId }})) -
  4. -
-

Here is the data from this request:

-

Declaration

- "I confirm that my information is correct and I am happy for it to be + I confirm that my information is correct and I am happy for it to be verified. I understand that false details may lead to my application being rejected, and that the Government of Barbados will keep my - information confidential." + information confidential.

diff --git a/src/email/templates/marriage-certificate.hbs b/src/email/templates/marriage-certificate.hbs index e1fccc9..98cefb0 100644 --- a/src/email/templates/marriage-certificate.hbs +++ b/src/email/templates/marriage-certificate.hbs @@ -114,29 +114,13 @@ Copies: {{ order.numberOfCopies }}

-
-

- Before you can process this request, you need 2 emails with matching - reference numbers: -

-
    -
  1. A certificate request email (this email).
  2. -
  3. - A payment confirmation email. -
    - (a separate email with the subject line: Marriage certificate - payment (reference number: {{ submissionId }})) -
  4. -
-

Here is the data from this request:

-

Declaration

- "I confirm that my information is correct and I am happy for it to be + I confirm that my information is correct and I am happy for it to be verified. I understand that false details may lead to my application being rejected, and that the Government of Barbados will keep my - information confidential." + information confidential.

From 8390da2b668c519e954ac556d53fed855bf7953b Mon Sep 17 00:00:00 2001 From: IsaiahSama Date: Wed, 28 Jan 2026 17:00:42 -0400 Subject: [PATCH 15/16] Now sanitzes input better for titleCase helper --- src/email/email.service.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/email/email.service.ts b/src/email/email.service.ts index 016d4ad..22b52ef 100644 --- a/src/email/email.service.ts +++ b/src/email/email.service.ts @@ -107,11 +107,13 @@ export class EmailService { Handlebars.registerHelper('titleCase', function(...args) { const values = args.slice(0, -1); - const titled = values.map(str => str.toLowerCase() - .replace(/\b\w/g, (char: string) => char.toUpperCase())) + const titled = values + .filter(v => typeof v === 'string') + .map(str => str.toLowerCase() + .replace(/\b\w/g, (char: string) => char.toUpperCase())) .join(" "); - return titled; + return Handlebars.escapeExpression(titled); }); this.logger.log('Handlebars helpers registered'); From 7949aaa3682adf103e3c46b2d5c6977badca6bdd Mon Sep 17 00:00:00 2001 From: IsaiahSama Date: Wed, 28 Jan 2026 17:16:09 -0400 Subject: [PATCH 16/16] Cleaned up content to match suggestions --- src/email/templates/birth-certificate.hbs | 51 +++++++++++------- src/email/templates/death-certificate.hbs | 53 ++++++++++++------- src/email/templates/marriage-certificate.hbs | 55 +++++++++++++------- 3 files changed, 102 insertions(+), 57 deletions(-) diff --git a/src/email/templates/birth-certificate.hbs b/src/email/templates/birth-certificate.hbs index b403165..073cee9 100644 --- a/src/email/templates/birth-certificate.hbs +++ b/src/email/templates/birth-certificate.hbs @@ -5,7 +5,7 @@ body { font-family: -apple-system, BlinkMacSystemFont, 'Figtree', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; - color: #333; + color: #000; margin: 0; padding: 0; font-style: normal; @@ -14,22 +14,26 @@ } .header { background-color: #ffc726; - padding: var(--xm, 24px) var(--m, 32px); + padding: 32px; } .container { max-width: 800px; margin: 0 auto; - padding: 20px; + padding: 64px 32px 32px 32px; + } + h1 { + color: #000; + margin: 0 0 16px 0; + font-size: 40px; + font-weight: 700; + line-height: 1.25; } - h1, h2 { color: #000; - padding-bottom: 5px; - margin-bottom: 5px; - font-size: 30px; - font-style: normal; + margin: 0 0 8px 0; + font-size: 20px; font-weight: 700; - line-height: 125%; /* 50px */ + line-height: 1.5; } table { width: 100%; @@ -45,7 +49,7 @@ width: 40%; } .section { - margin-top: 20px; + margin-top: 32px; } .footer { margin-top: 30px; @@ -56,10 +60,18 @@ text-align: left; } .submitted-info { - padding: var(--s, 15px); - border-radius: var(--xxs, 4px); - background: var(--blue-10, #e5e9f2); - line-height: 1; + padding: 16px; + border-radius: 4px; + background: #e5e9f2; + margin-bottom: 16px; + } + + .submitted-info p { + margin: 0 0 16px 0; + } + + .submitted-info p:last-child { + margin-bottom: 0; } .highlight { background-color: #fff3cd; @@ -68,6 +80,9 @@ border-radius: 4px; margin: 10px 0; } + .declaration-text { + margin-bottom: 8px; +} @@ -116,7 +131,7 @@

Declaration

-

+

I confirm that my information is correct and I am happy for it to be verified. I understand that false details may lead to my application being rejected, and that the Government of Barbados will keep my @@ -142,7 +157,7 @@

-

Applicant's name and Address

+

Applicant's name and address

{{#if applicant.title}} @@ -201,7 +216,7 @@ {{/if}} {{#if applicant.postalCode}} - + {{/if}} @@ -311,7 +326,7 @@
-

Parents' Details

+

Parents' details

Postal CodePostcode {{ applicant.postalCode }}
{{#if parents.father}} diff --git a/src/email/templates/death-certificate.hbs b/src/email/templates/death-certificate.hbs index 6e78307..9229d2f 100644 --- a/src/email/templates/death-certificate.hbs +++ b/src/email/templates/death-certificate.hbs @@ -5,7 +5,7 @@ body { font-family: -apple-system, BlinkMacSystemFont, 'Figtree', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; - color: #333; + color: #000; margin: 0; padding: 0; font-style: normal; @@ -14,22 +14,26 @@ } .header { background-color: #ffc726; - padding: var(--xm, 24px) var(--m, 32px); + padding: 32px; } .container { max-width: 800px; margin: 0 auto; - padding: 20px; + padding: 64px 32px 32px 32px; + } + h1 { + color: #000; + margin: 0 0 16px 0; + font-size: 40px; + font-weight: 700; + line-height: 1.25; } - h1, h2 { color: #000; - padding-bottom: 5px; - margin-bottom: 5px; - font-size: 30px; - font-style: normal; + margin: 0 0 8px 0; + font-size: 20px; font-weight: 700; - line-height: 125%; /* 50px */ + line-height: 1.5; } table { width: 100%; @@ -45,7 +49,7 @@ width: 40%; } .section { - margin-top: 20px; + margin-top: 32px; } .footer { margin-top: 30px; @@ -56,10 +60,18 @@ text-align: left; } .submitted-info { - padding: var(--s, 15px); - border-radius: var(--xxs, 4px); - background: var(--blue-10, #e5e9f2); - line-height: 1; + padding: 16px; + border-radius: 4px; + background: #e5e9f2; + margin-bottom: 16px; + } + + .submitted-info p { + margin: 0 0 16px 0; + } + + .submitted-info p:last-child { + margin-bottom: 0; } .highlight { background-color: #fff3cd; @@ -68,6 +80,9 @@ border-radius: 4px; margin: 10px 0; } + .declaration-text { + margin-bottom: 8px; +} @@ -119,7 +134,7 @@

Declaration

-

+

I confirm that my information is correct and I am happy for it to be verified. I understand that false details may lead to my application being rejected, and that the Government of Barbados will keep my @@ -145,7 +160,7 @@

-

Applicant's Name and Address

+

Applicant's name and address

{{#if applicant.title}} @@ -204,7 +219,7 @@ {{/if}} {{#if applicant.postalCode}} - + {{/if}} @@ -225,7 +240,7 @@
-

Relationship to the Person Named on the Certificate

+

Relationship to the person named on the certificate

Postal CodePostcode {{ applicant.postalCode }}
{{#if relationship}} @@ -255,7 +270,7 @@
-

Details of Death Certificate Required

+

Details of death certificate required

{{#if deceased.lastName}} diff --git a/src/email/templates/marriage-certificate.hbs b/src/email/templates/marriage-certificate.hbs index 98cefb0..6f799d4 100644 --- a/src/email/templates/marriage-certificate.hbs +++ b/src/email/templates/marriage-certificate.hbs @@ -5,7 +5,7 @@ body { font-family: -apple-system, BlinkMacSystemFont, 'Figtree', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; - color: #333; + color: #000; margin: 0; padding: 0; font-style: normal; @@ -14,22 +14,26 @@ } .header { background-color: #ffc726; - padding: var(--xm, 24px) var(--m, 32px); + padding: 32px; } .container { max-width: 800px; margin: 0 auto; - padding: 20px; + padding: 64px 32px 32px 32px; + } + h1 { + color: #000; + margin: 0 0 16px 0; + font-size: 40px; + font-weight: 700; + line-height: 1.25; } - h1, h2 { color: #000; - padding-bottom: 5px; - margin-bottom: 5px; - font-size: 30px; - font-style: normal; + margin: 0 0 8px 0; + font-size: 20px; font-weight: 700; - line-height: 125%; /* 50px */ + line-height: 1.5; } table { width: 100%; @@ -45,7 +49,7 @@ width: 40%; } .section { - margin-top: 20px; + margin-top: 32px; } .footer { margin-top: 30px; @@ -56,10 +60,18 @@ text-align: left; } .submitted-info { - padding: var(--s, 15px); - border-radius: var(--xxs, 4px); - background: var(--blue-10, #e5e9f2); - line-height: 1; + padding: 16px; + border-radius: 4px; + background: #e5e9f2; + margin-bottom: 16px; + } + + .submitted-info p { + margin: 0 0 16px 0; + } + + .submitted-info p:last-child { + margin-bottom: 0; } .highlight { background-color: #fff3cd; @@ -68,6 +80,9 @@ border-radius: 4px; margin: 10px 0; } + .declaration-text { + margin-bottom: 8px; +} @@ -116,7 +131,7 @@

Declaration

-

+

I confirm that my information is correct and I am happy for it to be verified. I understand that false details may lead to my application being rejected, and that the Government of Barbados will keep my @@ -200,7 +215,7 @@ {{/if}} {{#if applicant.postalCode}}

- + {{/if}} @@ -253,19 +268,19 @@
Postal CodePostcode {{ applicant.postalCode }}
- + - + - + - +
Husband – surnameHusband – Surname {{ husband.lastName }}
Husband – first nameHusband – First name {{ husband.firstName }}
Wife (maiden) – surnameWife (maiden) – Surname {{ wife.maidenName }}
Wife – first nameWife – First name {{ wife.firstName }}