1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 05:02:36 +01:00

Added check for mail config settings

This commit is contained in:
Hillel Coren 2016-01-11 13:07:41 +02:00
parent 26e1a0df8d
commit 61f3bedc48
2 changed files with 9 additions and 0 deletions

View File

@ -9,6 +9,12 @@ class Mailer
{
public function sendTo($toEmail, $fromEmail, $fromName, $subject, $view, $data = [])
{
// check the username is set
if ( ! env('POSTMARK_API_TOKEN') && ! env('MAIL_USERNAME')) {
return trans('texts.invalid_mail_config');
}
// don't send emails to dummy addresses
if (stristr($toEmail, '@example.com')) {
return true;
}

View File

@ -1032,4 +1032,7 @@ return array(
'color_font_help' => 'Note: the primary color and fonts are also used in the client portal and custom email designs.',
'live_preview' => 'Live Preview',
'invalid_mail_config' => 'Unable to send email, please check that the mail settings are correct.',
);