Ignore guzzle certifcate error for dev environments

This commit is contained in:
Jay Trees 2022-03-01 11:05:34 +01:00
parent 3ecd2c4ea0
commit 353a572c51
2 changed files with 18 additions and 1 deletions

View file

@ -31,7 +31,22 @@ class Email
$options->getOption('mjml_api_key'),
$options->getOption('mjml_api_secret')
);
$html = $renderer->render($this->mjml);
$html = $this->mjml;
if (ENV_IS_DEV) {
/**
* Ignore SSL certificate errors
*/
try {
$html = $renderer->render($this->mjml);
} catch (\GuzzleHttp\Exception\RequestException $th) {
error_log($th->getMessage());
}
} else {
$html = $renderer->render($this->mjml);
}
$to = $this->to;
$subject = $this->subject;

View file

@ -10,3 +10,5 @@ define('DATABASE_HOST', 'localhost');
define('DATABASE_NAME', 'wishthis');
define('DATABASE_USER', 'root');
define('DATABASE_PASSWORD', '');
define('ENV_IS_DEV', false);