mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-22 05:15:29 +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()
|
public function send()
|
||||||
{
|
{
|
||||||
|
$output = \ModuleHandler::triggerCall('mail.send', 'before', $this);
|
||||||
|
if(!$output->toBool())
|
||||||
|
{
|
||||||
|
$this->errors[] = $output->getMessage();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
return $this->driver->send($this);
|
$result = $this->driver->send($this);
|
||||||
}
|
}
|
||||||
catch(\Exception $e)
|
catch(\Exception $e)
|
||||||
{
|
{
|
||||||
$this->errors[] = $e->getMessage();
|
$this->errors[] = $e->getMessage();
|
||||||
|
$result = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
$output = \ModuleHandler::triggerCall('mail.send', 'after', $this);
|
||||||
|
if(!$output->toBool())
|
||||||
|
{
|
||||||
|
$this->errors[] = $output->getMessage();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue