Hello,
You can take advantage of handling the BizForm events (such as
OnAfterSave,
OnBeforeValidate etc.) and send the notification email using API. In your case, I would go for the
OnAfterSave that gets invoked after the BizForm data are saved.
You can clone and customize the BizForm web part and define the
OnAfterSave handler in the
SetupControl method (
Modifying the code of standard web parts):
viewBiz.OnAfterSave += new CMS.FormControls.BizForm.OnAfterSaveEventHandler(viewBiz_OnAfterSave);
In this handler, you can access form values using the
BizForm.BasicForm.DataRow property (
Bizforms customization possibilities):
void viewBiz_OnAfterSave()
{
DataRow row = viewBiz.BasicForm.DataRow;
string emailAddress = ValidationHelper.GetString(row["Email"], String.Empty);
string message = ValidationHelper.GetString(row["Message"], String.Empty);
CMS.EmailEngine.EmailMessage email = new CMS.EmailEngine.EmailMessage();
email.Recipients = "admin@admin.com";
email.Subject = "bizform";
email.From = emailAddress;
email.Body = message;
CMS.EmailEngine.EmailSender.SendEmail(email);
}
Best regards,
Michal Legen