mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-02 08:42:15 +09:00
Implement SMS logging and viewing
This commit is contained in:
parent
137728d527
commit
85c9b633ec
17 changed files with 307 additions and 31 deletions
|
|
@ -58,7 +58,6 @@ class Advanced_MailerController extends Advanced_Mailer
|
|||
if (toBool($config->log_sent_mail) || (toBool($config->log_errors) && count($mail->errors)))
|
||||
{
|
||||
$obj = new \stdClass();
|
||||
$obj->mail_srl = getNextSequence();
|
||||
$obj->mail_from = '';
|
||||
$obj->mail_to = '';
|
||||
|
||||
|
|
@ -99,9 +98,9 @@ class Advanced_MailerController extends Advanced_Mailer
|
|||
$obj->subject = $mail->message->getSubject();
|
||||
$obj->calling_script = $mail->getCaller();
|
||||
$obj->sending_method = strtolower(class_basename($mail->driver));
|
||||
$obj->status = !count($mail->errors) ? 'success' : 'error';
|
||||
$obj->errors = count($mail->errors) ? implode("\n", $mail->errors) : null;
|
||||
$output = executeQuery('advanced_mailer.insertLog', $obj);
|
||||
$obj->status = !count($mail->getErrors()) ? 'success' : 'error';
|
||||
$obj->errors = count($mail->getErrors()) ? implode("\n", $mail->getErrors()) : null;
|
||||
$output = executeQuery('advanced_mailer.insertMailLog', $obj);
|
||||
if (!$output->toBool())
|
||||
{
|
||||
return $output;
|
||||
|
|
@ -155,18 +154,27 @@ class Advanced_MailerController extends Advanced_Mailer
|
|||
|
||||
if (toBool($config->log_sent_sms) || (toBool($config->log_sms_errors) && count($sms->errors)))
|
||||
{
|
||||
return new Object();
|
||||
|
||||
$obj = new \stdClass();
|
||||
$obj->sms_srl = getNextSequence();
|
||||
$obj->sms_from = '';
|
||||
$obj->sms_to = '';
|
||||
$obj->content = $sms->getContent();
|
||||
$obj->sms_from = $sms->getFrom();
|
||||
$obj->sms_to = array();
|
||||
foreach ($sms->getRecipientsWithCountry() as $to)
|
||||
{
|
||||
if ($to->country)
|
||||
{
|
||||
$obj->sms_to[] = '+' . $to->country . '.' . $to->number;
|
||||
}
|
||||
else
|
||||
{
|
||||
$obj->sms_to[] = $to->number;
|
||||
}
|
||||
}
|
||||
$obj->sms_to = implode(', ', $obj->sms_to);
|
||||
$obj->content = trim($sms->getSubject() . "\n" . $sms->getBody());
|
||||
$obj->calling_script = $sms->getCaller();
|
||||
$obj->sending_method = strtolower(class_basename($sms->driver));
|
||||
$obj->status = !count($sms->errors) ? 'success' : 'error';
|
||||
$obj->errors = count($sms->errors) ? implode("\n", $sms->errors) : null;
|
||||
$output = executeQuery('advanced_mailer.insertLog', $obj);
|
||||
$obj->status = !count($sms->getErrors()) ? 'success' : 'error';
|
||||
$obj->errors = count($sms->getErrors()) ? implode("\n", $sms->getErrors()) : null;
|
||||
$output = executeQuery('advanced_mailer.insertSMSLog', $obj);
|
||||
if (!$output->toBool())
|
||||
{
|
||||
return $output;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue