Please enable JavaScript to view this site.

Navigation: Advanced topics > Events > Sample events > Email

Send mass email to all users

Scroll Prev Next More


To send an email with new data to email addresses from the user table, use the following code in one of the following events:

Add page: Before record added

Add page: After record added

Edit page: Before record updated

Edit page: After record updated




var rs = GlobalVars.dal.Table("UsersTableName").QueryAll();
XVar data;
var rmail = XVar.Array();
while (data = CommonFunctions.db_fetch_array(rs))
  rmail["to"] = data["EmailAddress"];
  rmail["body"] = "Check what's hot this season";
  rmail["subject"] = "Monthly newsletter";
  var ret = MVCFunctions.runner_mail(rmail);

See also:

About Database API

Send simple email

runner_mail function

DAL method: QueryAll()