I have written a custom workflow for Umbraco Forms which sends e-mails. A download link for the user should now be provided in a mail. My idea was to select the download file in the settings for the workflow and then insert it into the template, but I don't know how I get the settingsinformation in the template. Does anyone have an idea or maybe another approach?
Unfortuntely I don't have an exact answer on this but I'd definitely like to know as it may be something i'll need in the future.
However, depending on your requirements, you could provide a string input for the user to enter a url to the file and use that in your workflow.
I did something similar when I needed certain forms to redirect to certain urls.
[Umbraco.Forms.Core.Attributes.Setting("Redirect Url", description = "Enter the Url to redirect to. If left blank, the page will referesh and show the success message if available")]
public string RedirectUrl { get; set; }
public UrlRedirectWorkflow()
{
// Need to generate a new guid for the new custom workflow - add your own GUID
this.Id = new Guid("2ee335a5-50f8-4c95-a597-fde9b41959da");
this.Name = "Contact Redirect";
this.Description = "Redirect user after completing the contact form";
}
This created a setting on the work flow called Redirect Url.
Well, I already added such a field to my settings, but I don't see how I access these Settings in the email template(razor). I got only the data of the formfields in my email
E-Mail Template with Workflowsettings
Hello,
I have written a custom workflow for Umbraco Forms which sends e-mails. A download link for the user should now be provided in a mail. My idea was to select the download file in the settings for the workflow and then insert it into the template, but I don't know how I get the settingsinformation in the template. Does anyone have an idea or maybe another approach?
Thank you,
Yannick
Hi Yannick,
Unfortuntely I don't have an exact answer on this but I'd definitely like to know as it may be something i'll need in the future.
However, depending on your requirements, you could provide a string input for the user to enter a url to the file and use that in your workflow.
I did something similar when I needed certain forms to redirect to certain urls.
This created a setting on the work flow called Redirect Url.
I hope this helps short term. Kind Regards,
Lewis
Thank you Lewis for your answer.
Well, I already added such a field to my settings, but I don't see how I access these Settings in the email template(razor). I got only the data of the formfields in my email
Kind Regards
Yannick
Hi Yannick,
Again, a suggestion: You may want to try creating a new workflow that send emails.. The default one can be found here:
https://gist.github.com/TimGeyssens/6ff5392c4d9bbf89bdfc
Then you can hopefully manipulate this to incorporate your extra settings.
Kind Regards, Lewis
is working on a reply...