diff --git a/src/Orchard.Web/Modules/Orchard.DynamicForms/Handlers/FormSubmissionCoordinator.cs b/src/Orchard.Web/Modules/Orchard.DynamicForms/Handlers/FormSubmissionCoordinator.cs index f320206ee..920672473 100644 --- a/src/Orchard.Web/Modules/Orchard.DynamicForms/Handlers/FormSubmissionCoordinator.cs +++ b/src/Orchard.Web/Modules/Orchard.DynamicForms/Handlers/FormSubmissionCoordinator.cs @@ -29,6 +29,15 @@ namespace Orchard.DynamicForms.Handlers { var formName = form.Name; var values = context.Values; var formService = context.FormService; + var formValuesDictionary = values.ToTokenDictionary(); + var formTokenContext = new FormSubmissionTokenContext { + Form = form, + ModelState = context.ModelState, + PostedValues = values + }; + var tokensData = new Dictionary(formValuesDictionary) { + {"FormSubmission", formTokenContext}, + }; // Store the submission. if (form.StoreSubmission == true) { @@ -43,18 +52,10 @@ namespace Orchard.DynamicForms.Handlers { // Notifiy. if (!String.IsNullOrWhiteSpace(form.Notification)) - _notifier.Information(T(_tokenizer.Replace(T(form.Notification).Text, null))); + _notifier.Information(T(_tokenizer.Replace(T(form.Notification).Text, tokensData))); // Trigger workflow event. - var formValuesDictionary = values.ToTokenDictionary(); - var formTokenContext = new FormSubmissionTokenContext { - Form = form, - ModelState = context.ModelState, - PostedValues = values - }; - _workflowManager.TriggerEvent(DynamicFormSubmittedActivity.EventName, contentItem, () => new Dictionary(formValuesDictionary) { - {"FormSubmission", formTokenContext}, - }); + _workflowManager.TriggerEvent(DynamicFormSubmittedActivity.EventName, contentItem, () => tokensData); } } } \ No newline at end of file