Please enable JavaScript to view this site.

Navigation: Advanced topics > Events > Predefined actions

Events. Send email with new data

Scroll Prev Next More

 

Send email with new data action allows sending an email containing information about new data in the table.  

 

You can edit several parameters: the text and the subject of the message, the sender and recipient email addresses.

 

Available in the following events:

Add page: Before record added

Add page: After record added

Edit page: Before record updated

Edit page: After record updated

send_email_with_new_data_select_action

 

Note: To use this action, you have to set up the Email settings. Press button email_settings_button_events  on the toolbar or write the code manually.

 

 

 

'**********  Send email with new data (VB) ************

Dim email = "[email protected]"
Dim from = "[email protected]"
Dim msg = New StringBuilder("")
Dim subject = "New data record"
 
For Each field In values.GetEnumerator()
  If Not CType(CommonFunctions.IsBinaryType(pageObject.pSet.getFieldType(field.Key)), Boolean) Then
     msg.Append(field.Key.ToString() & " : " & field.Value.ToString() & Environment.NewLine)
  End If
Next
 
Dim ret = MVCFunctions.runner_mail(New XVar("to", email, "subject", subject, "body", msg.ToString(), "from", from))
If Not CType(ret("mailed"), Boolean) Then
  MVCFunctions.Echo(ret("message"))
End If

 

//**********  Send email with new data (C#) ************
 
string email = "[email protected]";
string from = "[email protected]";
StringBuilder msg = new StringBuilder("");
string subject = "New data record";
 
foreach(var field in values.GetEnumerator())
{
  if(!CommonFunctions.IsBinaryType(pageObject.pSet.getFieldType(field.Key)))
  {
    msg.Append(field.Key.ToString() + " : " + field.Value.ToString() + "\r\n");
  }
}
 
XVar ret = MVCFunctions.runner_mail(new XVar("to", email, "subject", subject, "body", msg.ToString(), "from", from));
if(!ret["mailed"])
{
  MVCFunctions.Echo(ret["message"]);
}

See also:

runner_mail function

Send mass email to all users

Send an email to selected users

Send simple email

Send email with old data

Email selected records

How to email selected records as separate PDF files