mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-20 08:22:17 +00:00
Added the capability to use a debug email address for receiving all the
sent emails
This commit is contained in:
@@ -54,7 +54,16 @@ class MailLib
|
||||
}
|
||||
|
||||
$this->ci->email->from($from, $alias);
|
||||
$this->ci->email->to($to);
|
||||
|
||||
// Check if the email address of the debug recipient is a valid one
|
||||
$recipient = $to;
|
||||
if ($this->validateEmailAddress(MAIL_DEBUG))
|
||||
{
|
||||
// if is it valid use it!!!
|
||||
$recipient = MAIL_DEBUG;
|
||||
}
|
||||
|
||||
$this->ci->email->to($recipient);
|
||||
if (!is_null($cc)) $this->ci->email->cc($cc);
|
||||
if (!is_null($bcc)) $this->ci->email->bcc($bcc);
|
||||
$this->ci->email->subject($subject);
|
||||
@@ -115,6 +124,21 @@ class MailLib
|
||||
return $cfg;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates an email address
|
||||
*/
|
||||
public function validateEmailAddress($emailAddress)
|
||||
{
|
||||
$valid = false;
|
||||
|
||||
if (!empty($emailAddress))
|
||||
{
|
||||
$valid = filter_var($emailAddress, FILTER_VALIDATE_EMAIL);
|
||||
}
|
||||
|
||||
return $valid;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if it has to wait until the sending of the next
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user