Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > BizForm - Dynamic "To-Email" on notification tab View modes: 
User avatar
Member
Member
jcarr - 7/21/2011 10:40:40 AM
   
BizForm - Dynamic "To-Email" on notification tab
I'm looking to dynamically change the "To-email" address on the notification email based on what form fields have been selected. I've researched on customizing the BizForm code-behind and am able to get to the form fields using the OnBeforeSave() event and then getting to my controls using FormName.BasicForm.FieldControls["FIELD"] but how can I access the "to-email" field to change it programatically?

Thanks

User avatar
Member
Member
kentico_michal - 7/24/2011 1:10:35 AM
   
RE:BizForm - Dynamic "To-Email" on notification tab
Hello,

You will need to change the FormSendToEmail property of the BizFormInfo object:


BizFormInfo bfi = BizFormInfoProvider.GetBizFormInfo("<BizForm code name>", CMS.CMSHelper.CMSContext.CurrentSiteID);
if (bfi != null)
{
bfi.FormSendToEmail = "<email address>";
BizFormInfoProvider.SetBizFormInfo(bfi);
}


Best regards,
Michal Legen