Skip to content

Commit 10bc55b

Browse files
committed
Replace annonymous function
1 parent efd5b73 commit 10bc55b

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

trunk/sparkpost.class.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,4 +98,13 @@ static function is_key_obfuscated($api_key)
9898
{
9999
return strpos($api_key, '*') !== false;
100100
}
101+
102+
public function init_sp_http_mailer($args)
103+
{
104+
global $phpmailer;
105+
if (!$phpmailer instanceof SparkPostHTTPMailer) {
106+
$phpmailer = new SparkPostHTTPMailer();
107+
}
108+
return $args;
109+
}
101110
}

trunk/wordpress-sparkpost.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,7 @@
3535
new SparkPostSMTPMailer();
3636
} else {
3737
require_once(WPSP_PLUGIN_DIR . 'mailer.http.class.php');
38-
add_filter('wp_mail', function ($args) {
39-
global $phpmailer;
40-
if (!$phpmailer instanceof SparkPostHTTPMailer) {
41-
$phpmailer = new SparkPostHTTPMailer();
42-
}
43-
return $args;
44-
});
38+
add_filter('wp_mail', array($sp, 'init_sp_http_mailer'));
4539
}
4640
}
4741

0 commit comments

Comments
 (0)