mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 05:02:36 +01: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)
|
||||
{
|
||||
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);
|
||||
$emailError = nl2br($response->Message);
|
||||
} else {
|
||||
|
@ -2227,7 +2227,8 @@ $LANG = array(
|
||||
'entity_state' => 'State',
|
||||
'payment_status_name' => 'Status',
|
||||
'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…
Reference in New Issue
Block a user