fixes:CAL-4905 (#18222)

This commit is contained in:
Hariom Balhara authored and GitHub committed 2024-12-17 22:51:42 +05:30
1 parent a0706d9b51
commit 4df4383e1e
2 files changed
+11 -6

No files matched your search

@@ -191,16 +191,18 @@ export async function onFormSubmission(
return acc;
}, [] as OrderedResponses);
if (form.settings?.emailOwnerOnSubmission) {
if (form.teamId) {
if (form.userWithEmails?.length) {
moduleLogger.debug(
`Preparing to send Form Response email for Form:${form.id} to users: ${form.userWithEmails.join(",")}`
);
await sendResponseEmail(form, orderedResponses, form.userWithEmails);
}
} else if (form.settings?.emailOwnerOnSubmission) {
moduleLogger.debug(
`Preparing to send Form Response email for Form:${form.id} to form owner: ${form.user.email}`
);
await sendResponseEmail(form, orderedResponses, [form.user.email]);
} else if (form.userWithEmails?.length) {
moduleLogger.debug(
`Preparing to send Form Response email for Form:${form.id} to users: ${form.userWithEmails.join(",")}`
);
await sendResponseEmail(form, orderedResponses, form.userWithEmails);
}
}
+3
View File
@@ -522,7 +522,10 @@ export const successRedirectUrl = z
export const RoutingFormSettings = z
.object({
// Applicable only for User Forms
emailOwnerOnSubmission: z.boolean(),
// Applicable only for Team Forms
sendUpdatesTo: z.array(z.number()).optional(),
sendToAll: z.boolean().optional(),
})