In DW9 it is possible to get notified, after contents of a form is saved, by using the OnAfterSubmitSave NotificationSubscriber.
I cannot find it in DW8 though. Is this not possible in this version?
Best regards
Kurt Moskjaer Andersen
In DW9 it is possible to get notified, after contents of a form is saved, by using the OnAfterSubmitSave NotificationSubscriber.
I cannot find it in DW8 though. Is this not possible in this version?
Best regards
Kurt Moskjaer Andersen
Hi Kurt,
No, that is not available. However, we do have a FormSaveProvider that may be of use:
using System; using System.Collections.Generic; using Dynamicweb.Extensibility; using Dynamicweb.Extensibility.AddIns; using Dynamicweb.Extensibility.Editors; using Dynamicweb.DataManagement; namespace T3 { [AddInName("T3.FormSaveProvider1"), AddInDescription("FormSaveProvider of the FormSaveProvider1"), AddInLabel("FormSaveProvider of the FormSaveProvider1")] public class FormSaveProvider1 : FormSaveProvider { #region Parameters [ AddInParameterGroup("Mail configuration"), AddInParameter("FormSaveProvider1.SenderName"), AddInLabel("Sender name"), AddInParameterEditor(typeof(TextParameterEditor), "NewGUI=true") ] public string MailFromName { get; set; } #endregion public override bool Save(FormSetting form, Dictionary<string, object> keysAndValues) { //TODO: Add code here } public override bool Save(FormSetting form, Dictionary<string, object> keysAndValues, string settings) { //TODO: Add code here } } }
Best regards
Morten
Hi Morten,
Thanks, will it work for Forms for Editors?
Best regards
Kurt
Unfortunately it does not look like it. :-\
In what context specifially do you need it? Is it when a form is saved in backend? Or when it is posted in frontend?
/Morten
Well, I wanted to make my own server-side validation, as I have a customer who recieves empty mails from time to time, even though the form fields are marked as required.
/Kurt
Hi Kurt
Notifications.Frontend.OnAfterSubmitSave is in DW8 after 8.6.1.0 (Dynamicweb.Modules.Forms.Notification in Dynamicweb.Modules namespace) can be used after the form submit was saved, but before emails are sent. So in that you can validate the post, delete the submit and raise an exception or redirect to a page, and mails are not sent.
BR Nicolai
Thanks Nicolai.
It isn't in 8.6.12, as I've just tested it, but I'm trying to make an upgrade to version 8.8.x, where it is in the Modules namespace.
/Kurt
You must be logged in to post in the forum