I know I can add individual form fields to the email template, but how would I go about adding something such as the record ID for each form submission.
Using the default email workflow, this was accomplished by using the {{recordId}} variable.
It would also be nice to have access to the form name.
thanks for your PR, it's highly appreciated. Unfortunately we didn't find anytime yet to merge in your PR, so sorry for that. We will get back in contact when we do!
Thank you for the package! Umbraco Forms has some major gaps in its email workflow and your package fills them in nicely.
That PR could use a quick update. It would be useful to have the form name and record date as well:
// Add form name
emailTags.Add(new EmailTag("[#formName#]", record.GetForm().Name));
// Add record created date
emailTags.Add(new EmailTag("[#recordCreated#]", record.Created.ToString(new CultureInfo("en-US"))));
// Add record id
emailTags.Add(new EmailTag("[#recordId#]", record.Id.ToString()));
I noticed that the date and time used in the workflow is just a stringified version of DateTime.Now . This will not accurately represent the record created date if the workflow is invoked on form approval rather than form submission.
Rather, the date and time should come directly from the record itself:
record.Created.ToString(new CultureInfo("en-US"))
You could take this a step further and check for a null record first (this will happen if Post Moderation is not eneabled), then you could return DateTime.Now.
Access record IDs in the email template
I know I can add individual form fields to the email template, but how would I go about adding something such as the record ID for each form submission.
Using the default email workflow, this was accomplished by using the {{recordId}} variable.
It would also be nice to have access to the form name.
Since this doesn't seem to be supported by default, I've created a PR with the added functionality.
https://github.com/PerplexInternetmarketing/PerplexMail-for-Umbraco/pull/4
Hi Matthew,
thanks for your PR, it's highly appreciated. Unfortunately we didn't find anytime yet to merge in your PR, so sorry for that. We will get back in contact when we do!
Thanks,
Jeffrey
Thank you for the package! Umbraco Forms has some major gaps in its email workflow and your package fills them in nicely.
That PR could use a quick update. It would be useful to have the form name and record date as well:
Solved!
After the most recent commit (thanks, Perplex), the following values are now included in the forms workflow:
https://github.com/PerplexInternetmarketing/PerplexMail-for-Umbraco/commit/2dffbc46d57879785cf2ce3cb305459eb24b621b
And updated the documentation too, with the new magical tags: https://our.umbraco.org/FileDownload?id=17684.
I noticed that the date and time used in the workflow is just a stringified version of DateTime.Now . This will not accurately represent the record created date if the workflow is invoked on form approval rather than form submission.
Rather, the date and time should come directly from the record itself:
You could take this a step further and check for a null record first (this will happen if Post Moderation is not eneabled), then you could return DateTime.Now.
is working on a reply...