mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-22 11:52:14 +09:00
Add Mail->isSent() method and clean up visibility of properties
This commit is contained in:
parent
14dfba32e4
commit
06f8643307
1 changed files with 16 additions and 5 deletions
|
|
@ -12,9 +12,10 @@ class Mail
|
|||
*/
|
||||
public $message = null;
|
||||
public $driver = null;
|
||||
public $content_type = 'text/html';
|
||||
public $attachments = array();
|
||||
protected $content_type = 'text/html';
|
||||
protected $attachments = array();
|
||||
public $errors = array();
|
||||
protected $sent = false;
|
||||
|
||||
/**
|
||||
* Static properties.
|
||||
|
|
@ -543,12 +544,12 @@ class Mail
|
|||
|
||||
try
|
||||
{
|
||||
$result = $this->driver->send($this);
|
||||
$this->sent = $this->driver->send($this) ? true : false;
|
||||
}
|
||||
catch(\Exception $e)
|
||||
{
|
||||
$this->errors[] = $e->getMessage();
|
||||
$result = false;
|
||||
$this->sent = false;
|
||||
}
|
||||
|
||||
$output = \ModuleHandler::triggerCall('mail.send', 'after', $this);
|
||||
|
|
@ -557,7 +558,17 @@ class Mail
|
|||
$this->errors[] = $output->getMessage();
|
||||
}
|
||||
|
||||
return $result;
|
||||
return $this->sent;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the message was sent.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isSent()
|
||||
{
|
||||
return $this->sent;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue