mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-01 00:02:21 +09:00
Add table and triggers for SMS logging
This commit is contained in:
parent
211a201e04
commit
137728d527
3 changed files with 47 additions and 0 deletions
|
|
@ -145,4 +145,32 @@ class Advanced_MailerController extends Advanced_Mailer
|
|||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* After SMS send trigger.
|
||||
*/
|
||||
public function triggerAfterSMSSend($sms)
|
||||
{
|
||||
$config = $this->getConfig();
|
||||
|
||||
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->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);
|
||||
if (!$output->toBool())
|
||||
{
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue