Issue with "Send Email with Template (Razor)" Workflow in Umbraco Forms
I am encountering an issue when trying to use the "Send email with template (razor)" workflow in Umbraco Forms. The problem occurs when I specify a custom Razor view for the email template, leading to the following error message:
Error parsing record with Razor view - /Views/Partials/Forms/Emails/EmailTemplateEmpty.cshtml
Stacktrace:
System.InvalidOperationException: Could not render view to string. Controller: Umbraco.Forms.Core.Controllers.RazorEmailViewController, View Path: /Views/Partials/Forms/Emails/EmailTemplateEmpty.cshtml.
at Umbraco.Forms.Web.Extensions.ControllerExtensions.RenderViewAsync[TModel](Controller controller, String viewPath, TModel model)
at Umbraco.Forms.Core.Providers.WorkflowTypes.SendRazorEmail.ParseWithRazorView(Record record, String razorViewFilePath)
at Umbraco.Forms.Core.Providers.WorkflowTypes.SendRazorEmail.Execute(WorkflowExecutionContext context)
However, when I use the built-in template Example-Template.cshtml, the workflow functions as expected without any issues. The problem arises when I try to use a template based on the example provided in the documentation (Umbraco Forms Documentation - Email Templates). I have also tried to add a template from an existing and working solution with the same result.
Even after clearing the template of all custom logic, leaving it as plain HTML, the issue persists. It seems like the Razor view is not being parsed correctly in the custom template path.
Could you help me identify what might be causing this issue or provide guidance on how to get custom Razor templates working for email workflows?
Issue with "Send Email with Template (Razor)" Workflow in Umbraco Forms
I am encountering an issue when trying to use the "Send email with template (razor)" workflow in Umbraco Forms. The problem occurs when I specify a custom Razor view for the email template, leading to the following error message:
Stacktrace:
However, when I use the built-in template Example-Template.cshtml, the workflow functions as expected without any issues. The problem arises when I try to use a template based on the example provided in the documentation (Umbraco Forms Documentation - Email Templates). I have also tried to add a template from an existing and working solution with the same result.
Even after clearing the template of all custom logic, leaving it as plain HTML, the issue persists. It seems like the Razor view is not being parsed correctly in the custom template path.
Could you help me identify what might be causing this issue or provide guidance on how to get custom Razor templates working for email workflows?
Environment:
Umbraco Forms Version: 12.2.4
Umbraco Version: 12.3.10
Minimum template
Thank you for your assistance!
Best regards, René
is working on a reply...