Hi,
Regrettably, it is not supported to modify values in the body of auto responder email directly. I would recommend you to disable autoresponder emails from
CMS Desk. You could modify
BizForm web part(
~\CMSWebParts\BizForms\bizform.ascx), so that it sends email in
OnAfterSave method, which is invoked when user submits new bizform record.
Please take a look at following code snippets, which ensures sending email to email address specified in
Email field of the bizform and as a body of the email are used 4 last digits of Message field.
Your ~\CMSWebParts\BizForms\bizform.ascx file should look like this:
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="~/CMSWebParts/BizForms/bizform.ascx.cs" Inherits="CMSWebParts_BizForms_bizform" %>
<cms:BizForm ID="viewBiz" runat="server" IsLiveSite="true" />
And here is your mentioned method
OnAfterSave:
protected void BizFormNew_OnAfterSave()
{
DataRow row = viewBiz.BasicForm.DataRow;
string message = row["Message"].ToString();
CMS.EmailEngine.EmailMessage email = new CMS.EmailEngine.EmailMessage();
email.Recipients = row["Email"].ToString();
email.Subject = "bizform";
email.From = "admin@admin.com";
email.Body = message.Substring(message.Length - 4);
CMS.EmailEngine.EmailSender.SendEmail(email);
}
You will need to add following code to in
SetupControl() (
~\CMSWebParts\BizForms\bizform.ascx.cs) method in order to register
OnAfterSave method:
BizFormNew.OnAfterSave += new BizForm.OnAfterSaveEventHandler(BizFormNew_OnAfterSave);
Best regards,
Michal Legen