mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Added check for mail config settings
This commit is contained in:
parent
26e1a0df8d
commit
61f3bedc48
@ -9,6 +9,12 @@ class Mailer
|
|||||||
{
|
{
|
||||||
public function sendTo($toEmail, $fromEmail, $fromName, $subject, $view, $data = [])
|
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')) {
|
if (stristr($toEmail, '@example.com')) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -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.',
|
'color_font_help' => 'Note: the primary color and fonts are also used in the client portal and custom email designs.',
|
||||||
|
|
||||||
'live_preview' => 'Live Preview',
|
'live_preview' => 'Live Preview',
|
||||||
|
'invalid_mail_config' => 'Unable to send email, please check that the mail settings are correct.',
|
||||||
|
|
||||||
|
|
||||||
);
|
);
|
Loading…
x
Reference in New Issue
Block a user