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

@@ -67,6 +67,7 @@ if ($this->is_id()) {
$raw_subject = $emailTemplate->get_et_subject();
$raw_message = $emailTemplate->get_et_message();
//var_dump($kid_array);
foreach ($kid_array as $kid) {
$personalizedSubject = $emailTemplate->personalize($raw_subject, array(
'uk_name' => $kid->get_uk_name(),
@@ -94,7 +95,7 @@ if ($this->is_id()) {
//Recipients
$mail->setFrom($emailTemplate->get_et_from_email(), $emailTemplate->get_et_from_name());
$mail->addBCC('tricsusz@gmail.com', 'Tóth Richárd'); // TEST
$mail->addBCC($kid->get_uk_notify_email(), $kid->get_uk_notify_name());
//$mail->addBCC($kid->get_uk_notify_email(), $kid->get_uk_notify_name());
//Content
@@ -105,8 +106,26 @@ if ($this->is_id()) {
//$mail->send();
//LOG SUCCESS
email_log::create_email_log(
$personalizedMessage,
$personalizedSubject,
$kid->get_uk_notify_name(),
$kid->get_uk_notify_email(),
$emailTemplate->get_et_id()
);
//TODO: Update kids last noti date
} catch (Exception $e) {
//LOG ERROR
email_log::create_email_log(
$personalizedMessage,
$personalizedSubject,
$kid->get_uk_notify_name(),
$kid->get_uk_notify_email(),
$emailTemplate->get_et_id(),
$e
);
}
}