- Addresses issues identified during code review

This commit is contained in:
Vlad
2016-01-06 19:19:06 -05:00
parent f1bf2bb097
commit 0dbe04c3f8
29 changed files with 493 additions and 438 deletions

View File

@@ -4,11 +4,15 @@ namespace MailPoet\Mailer\Methods;
if(!defined('ABSPATH')) exit;
class ElasticEmail {
function __construct($apiKey, $fromEmail, $fromName) {
$this->url = 'https://api.elasticemail.com/mailer/send';
$this->apiKey = $apiKey;
$this->fromEmail = $fromEmail;
$this->fromName = $fromName;
public $url = 'https://api.elasticemail.com/mailer/send';
public $api_key;
public $from_email;
public $from_name;
function __construct($api_key, $from_email, $from_name) {
$this->api_key = $api_key;
$this->from_email = $from_email;
$this->from_name = $from_name;
}
function send($newsletter, $subscriber) {
@@ -23,9 +27,9 @@ class ElasticEmail {
function getBody($newsletter, $subscriber) {
$body = array(
'api_key' => $this->apiKey,
'from' => $this->fromEmail,
'from_name' => $this->fromName,
'api_key' => $this->api_key,
'from' => $this->from_email,
'from_name' => $this->from_name,
'to' => $subscriber,
'subject' => $newsletter['subject']
);