mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-18 09:52:17 +09:00
Add mail.send (before/after) triggers
This commit is contained in:
parent
b971ea19ca
commit
4d1ada5f28
1 changed files with 17 additions and 1 deletions
|
|
@ -534,15 +534,31 @@ class Mail
|
|||
*/
|
||||
public function send()
|
||||
{
|
||||
$output = \ModuleHandler::triggerCall('mail.send', 'before', $this);
|
||||
if(!$output->toBool())
|
||||
{
|
||||
$this->errors[] = $output->getMessage();
|
||||
return false;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
return $this->driver->send($this);
|
||||
$result = $this->driver->send($this);
|
||||
}
|
||||
catch(\Exception $e)
|
||||
{
|
||||
$this->errors[] = $e->getMessage();
|
||||
$result = false;
|
||||
}
|
||||
|
||||
$output = \ModuleHandler::triggerCall('mail.send', 'after', $this);
|
||||
if(!$output->toBool())
|
||||
{
|
||||
$this->errors[] = $output->getMessage();
|
||||
return false;
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue