- The identity verification process was unsuccessful. -
- -- If the person is an Employee, please ask - them to reach out to their Human Resources representative to confirm - that their data is correct. -
- -- If the person has a Sponsored account, - please ask them to reach out to their Sponsor to confirm that their - data is correct. -
-- Welcome to Access Boston, the City of Boston's ID Verification - Service. -
- -- Please try to have the person go through the "Forgot Password" - function before performing the "Identity Verification" process. Using - this process means that not only will their password be reset, but any - devices they had registered for Multi-Factor Authentication will be - cleared from their account. At the end of this process, they will have - to re-do the full Access Boston registration process. -
-- Are you sure you want to quit the Identify Verification Process? -
- -- All unsaved changes will be lost and the process will have to be - restarted. -
-- The identity verification process was successful. -
- -Please proceed with password reset activities.
-- Access Boston will send you a security code when you log in on a new - computer, tablet, or phone. You’ll also need a code to reset your - password if you forget it. -
- -- This is called multi-factor authentication. It keeps your account - secure even if someone steals your password. -
- -- Use your cell phone number if you have one. This is the most secure - option. If you don’t have a phone, you can use a personal email - address instead. -
- -- You’ll need a new password for Access Boston. We’ve changed - the requirements for passwords to make sure that they’re - strong enough. -
- -- You’ll use this password when logging in to Access Boston - websites like The Hub. If you work in City Hall or for BPS - you’ll also use it for your desktop computer. -
- - {hasTemporaryPassword && ( -- Please look for an email from us with your temporary - password. -
- )} - -- We’ve made a few changes to make things more secure: -
- -- We’ll walk you through everything you need to do to get set - up.{' '} - {!account.needsNewPassword && ( - <> - Your password is already strong enough, so we just need to - set you up for security codes. - > - )} -
- -$fullStackTrace-
- You’ll need a new password for Access Boston. We’ve changed the requirements for passwords to make sure that they’re strong enough. -
-- You’ll use this password when logging in to Access Boston websites like The Hub. If you work in City Hall or for BPS you’ll also use it for your desktop computer. -
-- You’ll need a new password for Access Boston. We’ve changed the requirements for passwords to make sure that they’re strong enough. -
-- You’ll use this password when logging in to Access Boston websites like The Hub. If you work in City Hall or for BPS you’ll also use it for your desktop computer. -
-- Please look for an email from us with your temporary password. -
-- The identity verification process was unsuccessful. -
-- If the person is an - - Employee - - , please ask them to reach out to their Human Resources representative to confirm that their data is correct. -
-- If the person has a - - Sponsored - - account, please ask them to reach out to their Sponsor to confirm that their data is correct. -
-- Are you sure you want to quit the Identify Verification Process? -
-- All unsaved changes will be lost and the process will have to be restarted. -
-- The identity verification process was successful. -
-- Please proceed with password reset activities. -
-- Access Boston will send you a security code when you log in on a new computer, tablet, or phone. You’ll also need a code to reset your password if you forget it. -
-- This is called multi-factor authentication. It keeps your account secure even if someone steals your password. -
-- Use your cell phone number if you have one. This is the most secure option. If you don’t have a phone, you can use a personal email address instead. -
-- Access Boston will send you a security code when you log in on a new computer, tablet, or phone. You’ll also need a code to reset your password if you forget it. -
-- This is called multi-factor authentication. It keeps your account secure even if someone steals your password. -
-- Use your cell phone number if you have one. This is the most secure option. If you don’t have a phone, you can use a personal email address instead. -
-- Access Boston will send you a security code when you log in on a new computer, tablet, or phone. You’ll also need a code to reset your password if you forget it. -
-- This is called multi-factor authentication. It keeps your account secure even if someone steals your password. -
-- Use your cell phone number if you have one. This is the most secure option. If you don’t have a phone, you can use a personal email address instead. -
-- Access Boston will send you a security code when you log in on a new computer, tablet, or phone. You’ll also need a code to reset your password if you forget it. -
-- This is called multi-factor authentication. It keeps your account secure even if someone steals your password. -
-- Use your cell phone number if you have one. This is the most secure option. If you don’t have a phone, you can use a personal email address instead. -
-- Access Boston will send you a security code when you log in on a new computer, tablet, or phone. You’ll also need a code to reset your password if you forget it. -
-- This is called multi-factor authentication. It keeps your account secure even if someone steals your password. -
-- Use your cell phone number if you have one. This is the most secure option. If you don’t have a phone, you can use a personal email address instead. -
-- Access Boston will send you a security code when you log in on a new computer, tablet, or phone. You’ll also need a code to reset your password if you forget it. -
-- This is called multi-factor authentication. It keeps your account secure even if someone steals your password. -
-- Use your cell phone number if you have one. This is the most secure option. If you don’t have a phone, you can use a personal email address instead. -
-- We’ve made a few changes to make things more secure: -
-- We’ll walk you through everything you need to do to get set up. - -
-- We’ve made a few changes to make things more secure: -
-- We’ll walk you through everything you need to do to get set up. - - Your password is already strong enough, so we just need to set you up for security codes. -
-- We appreciate your willingness to make a difference in the City of - Boston. If you have any questions about your application, contact{' '} - - boardsandcommissions@boston.gov - - . -
-- Choose up to 5 boards and commissions from the list below. -
- > - ) : ( - <> -- You’ve chosen to apply to these boards and commissions: -
- -- You can change your selection by expanding the list below.{' '} - - You may apply for up to 5 boards or commissions at once. - -
- > - )} - -- You can apply for a board or commission that does not currently have - any open positions. We will review your application when a seat - opens. -
- -{snapToString('Renders email body applicant text 1')}- )) - .add('policy office html', () => ( - - )) - .add('policy office text', () => ( -
{snapToString('Renders email body policy office text 1')}- )); diff --git a/services-js/commissions-app/src/server/email/EmailContent.test.ts b/services-js/commissions-app/src/server/email/EmailContent.test.ts deleted file mode 100644 index dd0986980..000000000 --- a/services-js/commissions-app/src/server/email/EmailContent.test.ts +++ /dev/null @@ -1,52 +0,0 @@ -import EmailContent from './EmailContent'; - -const commissionsUri = 'http://zpappweb01/cityclerk/commissions/applications'; - -describe('Renders email body', () => { - const emailContent = new EmailContent(commissionsUri); - const applicationData = { - commissionNames: [ - 'Animal Control Commission', - 'Boston Redevelopment Authority (BRA)/Economic Development Industrial Corp (EDIC)', - 'Neighborhood Jobs Trust', - ], - firstName: 'Anna', - lastName: 'Applicant', - email: 'x@y.com', - applicationId: '23', - }; - - const singleBoardApplicationData = { - ...applicationData, - commissionNames: ['Zoning Commission'], - }; - - const applicantEmailBodies = emailContent.renderApplicantBodies( - applicationData - ); - const policyOfficeEmailBodies = emailContent.renderPolicyOfficeBodies( - applicationData - ); - - test('applicant HTML', () => { - expect(applicantEmailBodies.html).toMatchSnapshot(); - }); - - test('applicant HTML, single board', () => { - expect( - emailContent.renderApplicantBodies(singleBoardApplicationData).html - ).toMatchSnapshot(); - }); - - test('applicant text', () => { - expect(applicantEmailBodies.text).toMatchSnapshot(); - }); - - test('policy office HTML', () => { - expect(policyOfficeEmailBodies.html).toMatchSnapshot(); - }); - - test('policy office text', () => { - expect(policyOfficeEmailBodies.text).toMatchSnapshot(); - }); -}); diff --git a/services-js/commissions-app/src/server/email/EmailContent.ts b/services-js/commissions-app/src/server/email/EmailContent.ts deleted file mode 100644 index 21c5e5fbd..000000000 --- a/services-js/commissions-app/src/server/email/EmailContent.ts +++ /dev/null @@ -1,88 +0,0 @@ -import fs from 'fs'; -import path from 'path'; -import Handlebars from 'handlebars'; -import mjml2html from 'mjml'; - -require('./handlebars-helpers'); - -export interface TemplateData { - commissionNames: string[]; - firstName: string; - lastName: string; - email: string; - applicationId: string; - uri?: string; -} - -interface Templates { - MJML: any; - TEXT: any; -} - -interface RenderedEmailBodies { - html: string; - text: string; -} - -export default class EmailContent { - commissionsUri: string; - handlebarsTemplates: any; - templates: any; - - constructor(commissionsUri: string) { - this.commissionsUri = commissionsUri; - - this.handlebarsTemplates = { - applicant: this.readTemplateFiles('applicant'), - policyOffice: this.readTemplateFiles('policyOffice'), - }; - - this.templates = { - applicant: { - mjml: Handlebars.compile(this.handlebarsTemplates.applicant.MJML), - text: Handlebars.compile(this.handlebarsTemplates.applicant.TEXT), - }, - policyOffice: { - mjml: Handlebars.compile(this.handlebarsTemplates.policyOffice.MJML), - text: Handlebars.compile(this.handlebarsTemplates.policyOffice.TEXT), - }, - }; - } - - public renderApplicantBodies(data: TemplateData): RenderedEmailBodies { - return this.renderEmailBodies('applicant', data); - } - - public renderPolicyOfficeBodies(data: TemplateData): RenderedEmailBodies { - return this.renderEmailBodies('policyOffice', data); - } - - private renderEmailBodies( - recipient: 'applicant' | 'policyOffice', - data: TemplateData - ): RenderedEmailBodies { - const templateData = { - ...data, - uri: this.commissionsUri, - }; - - const htmlTemplate = this.templates[recipient].mjml; - const textTemplate = this.templates[recipient].text; - - const mjmlTemplate = htmlTemplate(templateData); - - return { - html: mjml2html(mjmlTemplate).html, - text: textTemplate(templateData), - }; - } - - private readTemplateFiles(recipient: string): Templates { - const p = path.resolve(__dirname, '../../../src/server/email'); - - return { - MJML: fs.readFileSync(`${p}/${recipient}.mjml.hbs`, 'utf-8'), - TEXT: fs.readFileSync(`${p}/${recipient}.text.hbs`, 'utf-8'), - }; - } -} diff --git a/services-js/commissions-app/src/server/email/__snapshots__/EmailContent.test.ts.snap b/services-js/commissions-app/src/server/email/__snapshots__/EmailContent.test.ts.snap deleted file mode 100644 index 04d4a5dbe..000000000 --- a/services-js/commissions-app/src/server/email/__snapshots__/EmailContent.test.ts.snap +++ /dev/null @@ -1,958 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`Renders email body applicant HTML 1`] = ` -" - - - -
-
-
-
|
-
-
-
-
-
-
-
- Hello Anna, - -Serving on a board or commission is one of the most impactful ways Bostonians can become active in their community. Thank you for your applications to: - -
|
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
|
-
-
-
-
|
-
-
-
-
-
-
-
- Hello Anna, - -Serving on a board or commission is one of the most impactful ways Bostonians can become active in their community. Thank you for your application to: - -
|
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
|
-
-
-
-
|
-
-
-
-
-
-
-
- Hello, - -A new application was received from Anna Applicant for the following Boards and Commissions: - -
|
-
Hello {{firstName}},
- -Serving on a board or commission is one of the most impactful ways Bostonians can become active in their community. Thank you for your application{{#compare commissionNames.length '>' 1}}s{{/compare}} to:
- -If you have any questions about your application, please contact boardsandcommissions@boston.gov.
-Hello,
- -A new application was received from {{firstName}} {{lastName}} for the following Boards and Commissions:
- -