Please enable JavaScript to view this site.

Navigation: Advanced topics > Events > Sample events > Email

Send an email with updated fields only

Scroll Prev Next More

 

To send an email with updated fields only, use the following code in Edit page: Before record updated event.

 

 

 

var rmail = XVar.Array();
var body = new StringBuilder();
body.AppendLine("Changed fields");
foreach(var pair in values.GetEnumerator())
{
 
  if (pair.Value != oldvalues[pair.Key])
    body.AppendLine(String.Format("{0}: {1}", pair.Key, pair.Value));
}
rmail["to"] = "[email protected]";
rmail["subject"] = "Sample subject";
rmail["body"] = body.ToString();
MVCFunctions.runner_mail(rmail);

See also:

Update selected

Send an email to all users

Send an email to selected users

Send simple email

runner_mail function

Email selected records