Skip to content

Commit

Permalink
Merge pull request #229 from bcgov/bug/intake-email
Browse files Browse the repository at this point in the history
Fix email not going out on submit
  • Loading branch information
kyle1morel authored Dec 20, 2024
2 parents 481a786 + ef15ad4 commit b306550
Showing 1 changed file with 16 additions and 19 deletions.
35 changes: 16 additions & 19 deletions frontend/src/components/housing/submission/SubmissionIntakeForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -334,23 +334,20 @@ async function onSubmit(data: any) {
try {
autoSaveRef.value?.stopAutoSave();
// Convert contact fields into contacts array object then remove form keys from data
const submissionData = omit(
{
...data,
contacts: [
{
firstName: data.contacts.contactFirstName,
lastName: data.contacts.contactLastName,
phoneNumber: data.contacts.contactPhoneNumber,
email: data.contacts.contactEmail,
contactApplicantRelationship: data.contacts.contactApplicantRelationship,
contactPreference: data.contacts.contactPreference
}
]
},
['contacts']
);
// Convert contact fields into contacts array object
const submissionData = {
...data,
contacts: [
{
firstName: data.contacts.contactFirstName,
lastName: data.contacts.contactLastName,
phoneNumber: data.contacts.contactPhoneNumber,
email: data.contacts.contactEmail,
contactApplicantRelationship: data.contacts.contactApplicantRelationship,
contactPreference: data.contacts.contactPreference
}
]
};
// Remove empty investigate permit objects
const filteredInvestigatePermits = submissionData.investigatePermits.filter(
Expand Down Expand Up @@ -388,11 +385,11 @@ async function emailConfirmation(actId: string, subId: string) {
try {
const configCC = getConfig.value.ches?.submission?.cc;
const body = confirmationTemplateSubmission({
'{{ contactName }}': formRef.value?.values.contactFirstName,
'{{ contactName }}': formRef.value?.values.contacts.contactFirstName,
'{{ activityId }}': actId,
'{{ submissionId }}': subId
});
let applicantEmail = formRef.value?.values.contactEmail;
let applicantEmail = formRef.value?.values.contacts.contactEmail;
let emailData = {
from: configCC,
to: [applicantEmail],
Expand Down

0 comments on commit b306550

Please sign in to comment.