CMS  Version 3.9
EmailLog Class Reference

Inherits DataItem.

Static Public Member Functions

static logEmail ($mgr, $toAddr, $rtn)
 Record email sent in a log. More...
 

Public Attributes

 $table = "email_log"
 
 $primary_key = "email_log_id"
 
 $fields
 

Detailed Description

Definition at line 8 of file email_log.inc.

Member Function Documentation

◆ logEmail()

static EmailLog::logEmail (   $mgr,
  $toAddr,
  $rtn 
)
static

Record email sent in a log.

Parameters
obj$mgrEmailManager
string$toAddr
boolean$rtn

Definition at line 31 of file email_log.inc.

32  {
33  // don't save log if email not sent.
34  if(!$rtn) return;
35 
36  if (Settings::getValue("email", "log_messages"))
37  {
38  $item = $mgr->item;
39 
40  $log = new EmailLog();
41  $log->recipient_name = "";
42  $log->recipient_email = $toAddr;
43  $log->sender_email = $mgr->emailFrom;
44  $log->sender_name = $mgr->emailName;
45  $log->subject = $mgr->subject;
46  $log->message = Settings::getValue("email", "log_message_bodies") ? $mgr->message : "";
47  $log->save();
48  }
49  }
static getValue($component, $name)
Retrieve the value of the specified Setting.
Definition: settings.inc:104

Member Data Documentation

◆ $fields

EmailLog::$fields
Initial value:
= array(
"email_log_id" => Number,
"sender_name" => String,
"sender_email" => String,
"recipient_name" => String,
"recipient_email" => String,
"subject" => String,
"message" => HTML,
"date_sent" => Timestamp,
)

Definition at line 13 of file email_log.inc.

◆ $primary_key

EmailLog::$primary_key = "email_log_id"

Definition at line 11 of file email_log.inc.

◆ $table

EmailLog::$table = "email_log"

Definition at line 10 of file email_log.inc.


The documentation for this class was generated from the following file: