diff --git a/react-email-preview/emails/EmailAddressVerificationOtp.stories.tsx b/react-email-preview/emails/EmailAddressVerificationOtp.stories.tsx
index 6c4a698483..0704b8d3c3 100644
--- a/react-email-preview/emails/EmailAddressVerificationOtp.stories.tsx
+++ b/react-email-preview/emails/EmailAddressVerificationOtp.stories.tsx
@@ -20,4 +20,5 @@ Default.args = {
otp: '123456',
minutesToExpiry: 30,
appName: 'FormSG',
+ formUrl: 'https://form.gov.sg/645b5f5372deb40012fe98123',
}
diff --git a/src/app/modules/verification/verification.service.ts b/src/app/modules/verification/verification.service.ts
index 078deebfda..45a5c13e4d 100644
--- a/src/app/modules/verification/verification.service.ts
+++ b/src/app/modules/verification/verification.service.ts
@@ -470,7 +470,7 @@ const sendOtpForField = (
: errAsync(new MalformedParametersError('Field id not present'))
case BasicField.Email:
// call email - it should validate the recipient
- return MailService.sendVerificationOtp(recipient, otp, otpPrefix)
+ return MailService.sendVerificationOtp(recipient, otp, otpPrefix, formId)
default:
return errAsync(new NonVerifiedFieldTypeError(fieldType))
}
diff --git a/src/app/services/mail/__tests__/mail.service.spec.ts b/src/app/services/mail/__tests__/mail.service.spec.ts
index 052c83ae9a..aafcaab2e9 100644
--- a/src/app/services/mail/__tests__/mail.service.spec.ts
+++ b/src/app/services/mail/__tests__/mail.service.spec.ts
@@ -78,6 +78,8 @@ describe('mail.service', () => {
describe('sendVerificationOtp', () => {
const MOCK_OTP = '123456'
+ const MOCK_FORM_ID = 'mockFormId'
+ const MOCK_FORM_URL = `${MOCK_APP_URL}/${MOCK_FORM_ID}`
const expectedArg = expect.objectContaining({
to: MOCK_VALID_EMAIL,
@@ -96,6 +98,7 @@ describe('mail.service', () => {
MOCK_VALID_EMAIL,
MOCK_OTP,
MOCK_OTP_PREFIX,
+ MOCK_FORM_URL,
)
// Assert
@@ -114,6 +117,7 @@ describe('mail.service', () => {
invalidEmail,
MOCK_OTP,
MOCK_OTP_PREFIX,
+ MOCK_FORM_URL,
)
// Assert
@@ -138,6 +142,7 @@ describe('mail.service', () => {
MOCK_VALID_EMAIL,
MOCK_OTP,
MOCK_OTP_PREFIX,
+ MOCK_FORM_URL,
)
// Assert
@@ -162,6 +167,7 @@ describe('mail.service', () => {
MOCK_VALID_EMAIL,
MOCK_OTP,
MOCK_OTP_PREFIX,
+ MOCK_FORM_URL,
)
// Assert
@@ -192,6 +198,7 @@ describe('mail.service', () => {
MOCK_VALID_EMAIL,
MOCK_OTP,
MOCK_OTP_PREFIX,
+ MOCK_FORM_URL,
)
// Assert
diff --git a/src/app/services/mail/mail.service.ts b/src/app/services/mail/mail.service.ts
index f7d30c5b19..037c89ae33 100644
--- a/src/app/services/mail/mail.service.ts
+++ b/src/app/services/mail/mail.service.ts
@@ -338,15 +338,20 @@ export class MailService {
recipient: string,
otp: string,
otpPrefix: string,
+ formId: string,
): ResultAsync