Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
hey out there,
i've written a custom workflow that's 99.9% the same as the Send email workflow that ships with umbraco forms.
Send email
what i'm trying to work out is if i can create an instance of the Send email workflow and pass my workflow properties to it?
seems crazy to duplicate the code!
i guess what i need is something like:
var sendEmailWorkflow = new SendEmailWorkflow(); sendEmailWorkflow.Email = myWorkflow.Email; sendEmailWorkflow.SenderEmail = myWorkflow.SenderEmail; ect.
is this possible? i'm digging around in the Umbraco.Forms.Core and Umbraco.Forms.Web dlls but i'm not finding anything yet...
Umbraco.Forms.Core
Umbraco.Forms.Web
well, i dug out a copy of dotpeak and started digging through the dlls...
and hey presto, i got something working ;)
this is the stripped down code:
var sendEmailWorkflow = new Umbraco.Forms.Core.Providers.WorkflowTypes.SendEmail(_xmlService, _contentSection) { Email = email, SenderEmail = SenderEmail, Subject = Subject, Message = Message, Attachment = Attachment }; sendEmailWorkflow.Execute(record, e);
i'm injecting the IXmlService and IContentSection into the constructor of my custom workflow.
IXmlService
IContentSection
the email property is the only difference in my custom workflow as i'm setting it based on a value in the form.
email
so far the above is working a treat. nice.
hope this helps someone out there.
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
hooking into an existing umbraco forms workflow from a custom workflow?
hey out there,
i've written a custom workflow that's 99.9% the same as the
Send email
workflow that ships with umbraco forms.what i'm trying to work out is if i can create an instance of the
Send email
workflow and pass my workflow properties to it?seems crazy to duplicate the code!
i guess what i need is something like:
is this possible? i'm digging around in the
Umbraco.Forms.Core
andUmbraco.Forms.Web
dlls but i'm not finding anything yet...well, i dug out a copy of dotpeak and started digging through the dlls...
and hey presto, i got something working ;)
this is the stripped down code:
i'm injecting the
IXmlService
andIContentSection
into the constructor of my custom workflow.the
email
property is the only difference in my custom workflow as i'm setting it based on a value in the form.so far the above is working a treat. nice.
hope this helps someone out there.
is working on a reply...