Skip to content

Commit

Permalink
VR-263: updated admin invite email.
Browse files Browse the repository at this point in the history
  • Loading branch information
n3op2 committed Nov 18, 2024
1 parent 03be2b2 commit deb7d14
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/controllers/connection/__tests__/newConnection.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ describe('NewConnectionController', () => {
})
expect(emailSpy.secondCall.args[1]?.pin).match(/[0-9]{6}/)
expect(emailSpy.secondCall.args[1]).to.deep.contain({
invitator: 'NAME',
receiver: 'NAME',
address:
'NAME, ADDRESS_LINE_1, ADDRESS_LINE_2, CARE_OF, LOCALITY, PO_BOX, POSTAL_CODE, COUNTRY, PREMISES, REGION',
})
Expand Down Expand Up @@ -555,7 +555,7 @@ describe('NewConnectionController', () => {
expect(emailSpy.firstCall.args[0]).equal('connection_invite_admin')
expect(emailSpy.firstCall.args[1]?.pin).match(/[0-9]{6}/)
expect(emailSpy.firstCall.args[1]).to.deep.contain({
invitator: 'NAME',
receiver: 'NAME',
address:
'NAME, ADDRESS_LINE_1, ADDRESS_LINE_2, CARE_OF, LOCALITY, PO_BOX, POSTAL_CODE, COUNTRY, PREMISES, REGION',
})
Expand Down
2 changes: 1 addition & 1 deletion src/controllers/connection/newConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ export class NewConnectionController extends HTMLController {
private async sendAdminEmail(company: CompanyProfile, pin: string) {
await neverFail(
this.email.sendMail('connection_invite_admin', {
invitator: company.company_name,
receiver: company.company_name,
address: [
company.company_name,
company.registered_office_address.address_line_1,
Expand Down
13 changes: 7 additions & 6 deletions src/models/emailServiceInt/templates/invitationAdmin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,29 @@ export default {
name: 'connection_invite_admin' as const,
template: async function (
env: Env,
params: { pin: string; invitator: string; address: string }
params: { pin: string; receiver: string; address: string }
): Promise<SendMailOptions> {
const companyHouse = new CompanyHouseEntity(env)
const localCompany = await companyHouse.localCompanyHouseProfile()
return {
to: env.get('EMAIL_ADMIN_ADDRESS'),
from: env.get('EMAIL_FROM_ADDRESS'),
subject: `Postal Code for Verification: Invitation from ${params.invitator} on Veritable`,
subject: `Postal Code for Verification: Invitation from ${params.receiver} on Veritable`,
text: `
Hi ${localCompany.company_name},
${params.invitator} as sent you a request to connect securely on Veritable. To complete the verification process, please enter the following 6-digit postal code within your Veritable instance.
Hi ${localCompany.company_name} Admin,
Please post this verification code to ${params.receiver}, to complete the verification process.
Verification Code: ${params.pin},
Address: ${params.address}
Verification Code: ${params.pin},
`,
html: await (
<>
<h1>{Html.escapeHtml(`Hi ${localCompany.company_name}`)}</h1>
<br />
<p>
{Html.escapeHtml(
`${params.invitator} as sent you a request to connect securely on Veritable. To complete the verification process, please enter the following 6-digit postal code within your Veritable instance.`
`Please post this verification code to ${params.receiver}, to complete the verification process.`
)}
</p>

Expand Down

0 comments on commit deb7d14

Please sign in to comment.