Skip to content

Commit

Permalink
Merge pull request #30 from SparkPost/fix-422
Browse files Browse the repository at this point in the history
Fix mailer issue with WP v4.2x
  • Loading branch information
rajumsys committed Apr 8, 2016
2 parents 65afc83 + 5853dca commit 12cd79b
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion admin.widget.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public function wpsp_admin_page()
</form>
<hr/>
<div>
<h2>Test Email</h2>
<h3>Test Email</h3>
<?php
if (isset($_POST['sp_test_email'])) {
$this->test_email_sending($_POST['to_email'], !empty($_POST['enable_debugging']));
Expand Down
8 changes: 6 additions & 2 deletions mailer.http.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ function __construct($exceptions = false)
parent::__construct($exceptions);
}

function mailSend($header, $body) { /** TODO check if need to use $header, $body */
return $this->sparkpostSend();
}

function sparkpostSend()
{
$this->edebug('Preparing request data');
Expand Down Expand Up @@ -147,8 +151,8 @@ protected function handle_response($response)
return false;
}

$this->edebug('Response headers: ' . print_r($result['headers'], true));
$this->edebug('Response body: ' . print_r($result['body'], true));
$this->edebug('Response headers: ' . print_r($response['headers'], true));
$this->edebug('Response body: ' . print_r($response['body'], true));

$body = json_decode($response['body']);
if (property_exists($body, 'errors')) {
Expand Down
5 changes: 4 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Contributors: sparkpost, rajuru
Tags: sparkpost, smtp, wp_mail, mail, email
Requires at least: 4.0
Tested up to: 4.4.2
Stable tag: 2.2.0
Stable tag: 2.2.1
License: GPLv2 or later

Send all your email from Wordpress through SparkPost, the most advanced email delivery service.
Expand Down Expand Up @@ -47,6 +47,9 @@ Visit our [support site](https://support.sparkpost.com/) for help.

== Changelog ==

= 2.2.1 =
- Fix issue for previous version of WordPress

= 2.2.0 =
- Add template field for selecting a SparkPost template when using HTTP API
- Allow substituion of Subject, From name in HTTP API
Expand Down
2 changes: 1 addition & 1 deletion wordpress-sparkpost.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
Plugin Name: SparkPost
Plugin URI: http://sparkpost.com/
Description: Send all your email from Wordpress through SparkPost, the world's most advanced email delivery service.
Version: 2.2.0
Version: 2.2.1
Author: SparkPost
Author URI: http://sparkpost.com
License: GPLv2 or later
Expand Down

0 comments on commit 12cd79b

Please sign in to comment.