Skip to content

Commit 029eac8

Browse files
committed
Minor refactor
1 parent 89bffb8 commit 029eac8

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

mailer.http.class.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -255,12 +255,12 @@ protected function get_request_headers($hide_api_key = false)
255255
}
256256

257257
/**
258-
* Returns the list of Reply-To headers
258+
* Returns the list of Reply-To recipients
259259
* For WordPress version below 4.6
260260
* @return array
261261
* TODO Remove this when wordpress does not support version below 4.6
262262
*/
263-
protected function get_reply_to_below46()
263+
protected function parse_reply_to_from_custom_header()
264264
{
265265
$replyTos = array();
266266
foreach ($this->CustomHeader as $header) { // wp_mail sets Reply-To as custom header (does not use phpmailer->addReplyTo)
@@ -278,7 +278,7 @@ protected function get_reply_to_below46()
278278
* For WordPress 4.6 and above
279279
* @return array Formatted list of reply tos
280280
*/
281-
protected function get_reply_to_above46()
281+
protected function parse_reply_to()
282282
{
283283
$replyTos = array();
284284
foreach ($this->ReplyTo as $reply_to) {
@@ -294,12 +294,13 @@ protected function get_reply_to_above46()
294294
return implode(',', $replyTos);
295295
}
296296

297-
protected function get_reply_to() {
297+
protected function get_reply_to()
298+
{
298299
$wp_version = get_bloginfo('version');
299300
if(version_compare($wp_version, '4.6') == -1) { // if lower than 4.6
300-
return $this->get_reply_to_below46();
301+
return $this->parse_reply_to_from_custom_header();
301302
} else {
302-
return $this->get_reply_to_above46();
303+
return $this->parse_reply_to();
303304
}
304305
}
305306

readme.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Contributors: sparkpost, rajuru
33
Tags: sparkpost, smtp, wp_mail, mail, email
44
Requires at least: 4.0
55
Tested up to: 4.6
6-
Stable tag: 2.4.0
6+
Stable tag: 2.4.1
77
License: GPLv2 or later
88

99
Send all your email from WordPress through SparkPost, the most advanced email delivery service.
@@ -48,7 +48,7 @@ Visit our [support site](https://support.sparkpost.com/) for help.
4848
== Changelog ==
4949

5050
= 2.4.1=
51-
- Fix ReplyTo header issue with WordPress 4.6
51+
- Fix Reply-To header issue with WordPress 4.6
5252

5353
= 2.4.0 =
5454
- Add supports for CC and BCC using HTTP API

0 commit comments

Comments
 (0)