Hi,
Yes, this is possible.
Please find example PSEUDO code below (Please note that you might adjust this code, because this is just an example pseudo code):
string bizFormName = "TestingSiteContactUs";
string siteName = "CMSTestingSite";
// Read BizForm definition
BizFormInfo bfi = BizFormInfoProvider.GetBizFormInfo(bizFormName, siteName);
// Read data type definition
DataClassInfo dci = DataClassInfoProvider.GetDataClass(bfi.FormClassID);
GeneralConnection genConn = ConnectionHelper.GetConnection();
//save the data into bizform table using the example code
// …
// formRecord.ID is taken from the example code from developer’s guide
// Dataclass object
IDataClass content = DataClassFactory.NewDataClass(dci.ClassName, formRecord.ID, genConn);
if (!(formItem.IsEmpty()))
{
DataRow row = content.DataRow;
}
// Get confirmation sender and recepient email addresses
object email = DataHelper.GetDataRowValue(row, bfi.FormConfirmationEmailField);
string sendConfirmEmailTo = ValidationHelper.GetString(email, "");
string sendConfirmEmailFrom = bfi.FormConfirmationSendFromEmail;
// Get sender and recipient email addresses
string sendFromEmail = bfi.FormSendFromEmail;
string sendToEmail = bfi.FormSendToEmail;
bool sendEmailtoAdmin = ((!String.IsNullOrEmpty(sendFromEmail)) && (!String.IsNullOrEmpty(sendToEmail)));
bool sendEmailtoCustomer = ((!String.IsNullOrEmpty(sendConfirmEmailFrom)) && (sendConfirmEmailTo != ""));
if (sendEmailtoAdmin || sendEmailtoCustomer)
{
if (sendEmailtoAdmin)
{
CMS.FormControls.BizForm bizform = new CMS.FormControls.BizForm();
// Send notification e-mail
bizform.SendNotificationEmail(sendFromEmail, sendToEmail, row, bfi, content);
}
if (sendEmailtoCustomer)
{
CMS.FormControls.BizForm bizform = new CMS.FormControls.BizForm();
// Send confirmation e-mail
bizform.SendConfirmationEmail(sendConfirmEmailFrom, sendConfirmEmailTo, row, bfi);
}
}
I hope this will help you.
Best regards,
Miroslav Remias.