fix: customTemplate() function fails when no locale is given (#10201)

* fallback to en for locale

* remove console.log

* Fix nit changes

---------

Co-authored-by: CarinaWolli <[email protected]>
Co-authored-by: alannnc <[email protected]>
This commit is contained in:
authored and GitHub committed 2023-07-17 16:38:37 -07:00
1 parent 6a8db56dbb
commit c26efcabe4
4 files changed
+28 -18

No files matched your search

@@ -116,7 +116,7 @@ async function handler(req: NextApiRequest, res: NextApiResponse) {
const customMessage = customTemplate(
reminder.workflowStep.reminderBody || "",
variables,
locale || ""
locale || "en"
);
message = customMessage.text;
} else if (reminder.workflowStep.template === WorkflowTemplates.REMINDER) {