Add space between if and ‘(‘

[MAILPOET-1791]
This commit is contained in:
Ján Mikláš
2019-02-13 13:08:49 +01:00
committed by M. Shull
parent a935b091d3
commit 3ee58aea10
333 changed files with 4001 additions and 4001 deletions

View File

@@ -6,7 +6,7 @@ use MailPoet\Mailer\Mailer;
use MailPoet\Mailer\Methods\ErrorMappers\SendGridMapper;
use MailPoet\WP\Functions as WPFunctions;
if(!defined('ABSPATH')) exit;
if (!defined('ABSPATH')) exit;
class SendGrid {
public $url = 'https://api.sendgrid.com/api/mail.send.json';
@@ -32,11 +32,11 @@ class SendGrid {
$this->url,
$this->request($newsletter, $subscriber, $extra_params)
);
if(is_wp_error($result)) {
if (is_wp_error($result)) {
$error = $this->error_mapper->getConnectionError($result->get_error_message());
return Mailer::formatMailerErrorResult($error);
}
if($this->wp->wpRemoteRetrieveResponseCode($result) !== 200) {
if ($this->wp->wpRemoteRetrieveResponseCode($result) !== 200) {
$response = json_decode($result['body'], true);
$error = $this->error_mapper->getErrorFromResponse($response, $subscriber);
return Mailer::formatMailerErrorResult($error);
@@ -53,16 +53,16 @@ class SendGrid {
'subject' => $newsletter['subject']
);
$headers = array();
if(!empty($extra_params['unsubscribe_url'])) {
if (!empty($extra_params['unsubscribe_url'])) {
$headers['List-Unsubscribe'] = '<' . $extra_params['unsubscribe_url'] . '>';
}
if($headers) {
if ($headers) {
$body['headers'] = json_encode($headers);
}
if(!empty($newsletter['body']['html'])) {
if (!empty($newsletter['body']['html'])) {
$body['html'] = $newsletter['body']['html'];
}
if(!empty($newsletter['body']['text'])) {
if (!empty($newsletter['body']['text'])) {
$body['text'] = $newsletter['body']['text'];
}
return $body;