email logs; list only

This commit is contained in:
Ricsi
2018-10-23 15:32:08 +02:00
parent 19aaa4a770
commit 85180a91b6
11 changed files with 635 additions and 456 deletions

View File

@@ -4,23 +4,45 @@ class email_log {
private $el_id;
private $el_message;
private $el_subject;
private $el_from_name;
private $el_from_email;
private $el_to_name;
private $el_to_email;
private $el_sent_date;
private $el_exception;
private $el_email_template_et_id;
public function set_et_data_by_id($_id) {
public function set_el_data_by_id($_id) {
global $sql;
$et_data_assoc_array = $sql->assoc_array("select * from email_template where et_id = " . $_id);
$et_data_array = $et_data_assoc_array[0];
foreach ($et_data_array as $field => $value) {
$el_data_assoc_array = $sql->assoc_array("select * from email_log where el_id = " . $_id);
$el_data_array = $el_data_assoc_array[0];
foreach ($el_data_array as $field => $value) {
$function_name = "set_" . $field;
$this->$function_name($value);
if ('el_email_template_et_id' == $field) {
$new_et = new email_template();
$new_et->set_et_data_by_id($value);
$this->set_el_email_template_et_id($new_et);
}
}
}
public static function create_email_log($_message, $_subject, $_name, $_email, $_et, $_exc = 'null', $_date = null)
{
global $sql;
if (null === $_date) {
$_date = date('Y-m-d H:i:s');
}
return $sql->insert_into('email_log', array(
'el_message' => $_message,
'el_subject' => $_subject,
'el_to_name' => $_name,
'el_to_email' => $_email,
'el_email_template_et_id' => $_et,
'el_exception' => $_exc,
'el_sent_date' => $_date
));
}
/**
* @return mixed
@@ -85,19 +107,19 @@ class email_log {
/**
* @return mixed
*/
public function get_el_from_name()
public function get_el_to_name()
{
return $this->el_from_name;
return $this->el_to_name;
}
/**
* @param mixed $el_from_name
* @param mixed $el_to_name
*
* @return self
*/
public function set_el_from_name($el_from_name)
public function set_el_to_name($el_to_name)
{
$this->el_from_name = $el_from_name;
$this->el_to_name = $el_to_name;
return $this;
}
@@ -105,19 +127,19 @@ class email_log {
/**
* @return mixed
*/
public function get_el_from_email()
public function get_el_to_email()
{
return $this->el_from_email;
return $this->el_to_email;
}
/**
* @param mixed $el_from_email
* @param mixed $el_to_email
*
* @return self
*/
public function set_el_from_email($el_from_email)
public function set_el_to_email($el_to_email)
{
$this->el_from_email = $el_from_email;
$this->el_to_email = $el_to_email;
return $this;
}