Hi,
I got it working and bizfrom is sending to any email address that i want. thanks :)
only issue i have now is, the order of the fields that are sent in email is'nt the order that the fields appear in cmsdesk ->tools -> bizform -> ( actuall bizfrom) -> fields
example:
in
DataClass formRecord the order of fields from bizfrom is:
- ColumnNames {string[15]} string[]
[0] "MaintenenceRequestID" string
[1] "FormInserted" string
[2] "FormUpdated" string
[3] "Name" string
[4] "Phone" string
[5] "Email" string
[6] "Apartment" string
[7] "emailRecipient" string
[8] "state" string
[9] "city" string
[10] "neighborhood" string
[11] "building" string
[12] "Suggestions" string
[13] "emailSubject" string
[14] "emailFrom" string
this is code that builds email:
// Get all bizform data
GeneralConnection genConn = ConnectionHelper.GetConnection();
DataSet ds = genConn.ExecuteQuery(dci.ClassName + ".selectall", null, null, null);
if (!DataHelper.DataSourceIsEmpty(ds))
{
// Get ID of the first record -- NEED TO GET ID ON NEW ITEM
int formRecordID = viewBiz.ItemID;//ValidationHelper.GetInteger(ds.Tables[0].Rows[0][0], 0);
// Get the record with ID of the first row record
DataClass formRecord = new DataClass(dci.ClassName, formRecordID, genConn);
if (!formRecord.IsEmpty())
{
// get ID of any bizfrom
formContent += formRecord.ColumnNames[0] + ": " + formRecord.DataRow.ItemArray[0] + "<br />";
int skipFields = 0;
// skip fields that shouldnt be sent in email
if (BizFormName == "SubmitSuggestions")
{ skipFields += 5; }
else
{ skipFields += 4; }
//(formRecord.ColumnsCount - 2) this gets rid of last two fields: formInserted + formUpdated
for (int i = skipFields; i <= (formRecord.ColumnsCount - 2); i++)
{
formContent += formRecord.ColumnNames + ": " + formRecord.DataRow.ItemArray + "<br />";
}
}
}
else
{
// lblInfo.Text = "No data found.";
}
I want the order to be:
Thanks