I don't remember doing anything special - my code and namespaces are broadly similar to the link in the first post. Here's the relevant extract, if that helps:
public override WorkflowExecutionStatus Execute(Record record, RecordEventArgs e)
{
MailMessage m = new MailMessage();
m.From = new MailAddress(Properties.Settings.Default.emailFrom);
m.Subject = Subject;
m.IsBodyHtml = true;
var bodyFromView = record.ParseWithRazorView("~/Views/Partials/" + EmailTemplate);
m.Body = bodyFromView ;
SmtpClient s = new SmtpClient(Properties.Settings.Default.smtpServer);
s.Send(m);
return WorkflowExecutionStatus.Completed;
}
Ok, thanks. But for some reason this doesn't work for me.
When I use that exact code I still get "CS1061: 'Record' does not contain a definition for 'ParseWithRazorView' and no accessible extension method 'ParseWithRazorView' accepting a first argument of type 'Record' could be found (are you missing a using directive or an assembly reference?"
Btw, I'm using Umbraco Forms version 8.6.0
I've got it working now with a plain .html-file as a workaround, but would be nice if I can use the Picker-functionality from Forms itself. Maybe someone else reads this and got the solution :-)
Custom workflow using email template
I've created a custom workflow to allow me to CC form submissions to an email address using https://our.umbraco.com/forum/umbraco-forms/87822-how-to-add-reply-to-bcc-functionality-to-umbraco-forms as a basis.
I'd now like to include the "razor email template functionality" of the default workflow. I've added
So I've got a picker working now, but I'm not sure how to combine the form submission with the template.
I've seen this on the forums, but it seems a bit long winded for something that's already built in somewhere.
Can anybody point me in the right direction?
Turns out there is an easier way. Within your custom workflow's execute method you can do
Easy when you know how.
How did you get this working? When I add:
I get "'Record does not contain a definition for 'ParseWithRazorView'", and I don't get any suggestions for using namespaces...
I don't remember doing anything special - my code and namespaces are broadly similar to the link in the first post. Here's the relevant extract, if that helps:
Ok, thanks. But for some reason this doesn't work for me.
When I use that exact code I still get "CS1061: 'Record' does not contain a definition for 'ParseWithRazorView' and no accessible extension method 'ParseWithRazorView' accepting a first argument of type 'Record' could be found (are you missing a using directive or an assembly reference?"
Btw, I'm using Umbraco Forms version 8.6.0
I've got it working now with a plain .html-file as a workaround, but would be nice if I can use the Picker-functionality from Forms itself. Maybe someone else reads this and got the solution :-)
Ah I'm using v7 forms, so that could be it.
Hey Rick,
Any update on this one? Also can you please elaborate on the workaround for this one?
Thanks :)
Sorry, but I actually have no idea anymore which project this was... So can't look it up for you... Sorry :)
this is working for v8:
is working on a reply...