mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Improve error if email fails to send
This commit is contained in:
parent
b03b1ec6cd
commit
a99079da95
@ -102,7 +102,15 @@ class Mailer
|
|||||||
private function handleFailure($exception)
|
private function handleFailure($exception)
|
||||||
{
|
{
|
||||||
if (isset($_ENV['POSTMARK_API_TOKEN']) && method_exists($exception, 'getResponse')) {
|
if (isset($_ENV['POSTMARK_API_TOKEN']) && method_exists($exception, 'getResponse')) {
|
||||||
$response = $exception->getResponse()->getBody()->getContents();
|
$response = $exception->getResponse();
|
||||||
|
|
||||||
|
if (! $response) {
|
||||||
|
$error = trans('texts.postmark_error', ['link' => link_to('https://status.postmarkapp.com/')]);
|
||||||
|
Utils::logError($error);
|
||||||
|
return $error;
|
||||||
|
}
|
||||||
|
|
||||||
|
$response = $response->getBody()->getContents();
|
||||||
$response = json_decode($response);
|
$response = json_decode($response);
|
||||||
$emailError = nl2br($response->Message);
|
$emailError = nl2br($response->Message);
|
||||||
} else {
|
} else {
|
||||||
|
@ -2227,7 +2227,8 @@ $LANG = array(
|
|||||||
'entity_state' => 'State',
|
'entity_state' => 'State',
|
||||||
'payment_status_name' => 'Status',
|
'payment_status_name' => 'Status',
|
||||||
'client_created_at' => 'Date Created',
|
'client_created_at' => 'Date Created',
|
||||||
'json_import_help' => 'We recommend importing into an empty account.'
|
'json_import_help' => 'We recommend importing into an empty account.',
|
||||||
|
'postmark_error' => 'There was a problem sending the email through Postmark: :link',
|
||||||
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user