@@ -5,6 +5,7 @@ import { createDynamoDbClient } from "@db/config/dynamoDbConfig";
55import { DynamoMessagesDataClient } from "@db/DynamoMessagesDataClient" ;
66import { DynamoUserDataClient } from "@db/DynamoUserDataClient" ;
77import {
8+ EmailType ,
89 MessageData ,
910 type MessageChannel ,
1011 type MessageTemplateId ,
@@ -21,6 +22,7 @@ import {
2122 STAGE ,
2223 USERS_TABLE ,
2324} from "@functions/config" ;
25+ import { REMINDER_EMAIL_CONFIG_SET_NAME , WELCOME_EMAIL_CONFIG_SET_NAME } from "@libs/constants" ;
2426import { LogWriter , LogWriterType } from "@libs/logWriter" ;
2527import { getConfigValue , USER_MESSAGING_CONFIG_VARS } from "@libs/ssmUtils" ;
2628import { v4 as uuidv4 } from "uuid" ;
@@ -159,7 +161,7 @@ export const handler = async (
159161const buildWelcomeEmail = ( props : { toEmail : string } ) : SendEmailCommand => {
160162 return buildSesEmailCommand ( {
161163 toEmail : props . toEmail ,
162- emailType : "welcome-email" ,
164+ emailType : WELCOME_EMAIL_CONFIG_SET_NAME ,
163165 subject : "Welcome to Business.NJ.gov" ,
164166 htmlBody : welcomeEmailShortVersionTemplate ,
165167 fallbackText : welcomeEmailShortVersionPlaintext ,
@@ -169,7 +171,7 @@ const buildWelcomeEmail = (props: { toEmail: string }): SendEmailCommand => {
169171const buildReminderEmail = ( props : { toEmail : string } ) : SendEmailCommand => {
170172 return buildSesEmailCommand ( {
171173 toEmail : props . toEmail ,
172- emailType : "test-reminder-email" ,
174+ emailType : REMINDER_EMAIL_CONFIG_SET_NAME ,
173175 subject : "Incomplete Tasks Reminder - Business.NJ.gov" ,
174176 htmlBody : testReminderHtmlTemplate ,
175177 } ) ;
@@ -199,7 +201,7 @@ const buildMessageRecord = (props: {
199201
200202const buildSesEmailCommand = ( props : {
201203 toEmail : string ;
202- emailType : string ;
204+ emailType : EmailType ;
203205 subject : string ;
204206 fallbackText ?: string ;
205207 htmlBody : string ;
@@ -234,6 +236,7 @@ const buildSesEmailCommand = (props: {
234236 Value : props . emailType ,
235237 } ,
236238 ] ,
239+ ConfigurationSetName : props . emailType ,
237240 } ;
238241 return new SendEmailCommand ( input ) ;
239242} ;
0 commit comments