Skip to content

Commit 874d1bc

Browse files
committed
fix template id setting by hook when no template id is specified in settings
1 parent c343ba5 commit 874d1bc

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

mailer.http.class.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,16 +86,18 @@ protected function get_request_body()
8686
'transactional' => (bool) apply_filters('wpsp_transactional', $this->settings['transactional'])
8787
);
8888

89+
$template_id = apply_filters('wpsp_template_id', $this->settings['template']);
90+
8991
// pass through either stored template or inline content
90-
if (!empty($this->settings['template'])) {
92+
if (!empty($template_id)) {
9193
// stored template
92-
$body['content']['template_id'] = apply_filters('wpsp_template_id', $this->settings['template']);
94+
$body['content']['template_id'] = $template_id;
9395

9496
// supply substitution data so users can add variables to templates
9597
$body['substitution_data']['content'] = $this->Body;
9698
$body['substitution_data']['subject'] = $this->Subject;
9799
$body['substitution_data']['from_name'] = $sender['name'];
98-
$body['substitution_data']['from'] = $sender['name'] . ' <' . $sender['email'] . '>';
100+
$body['substitution_data']['from'] = $sender['email'];
99101
if ($replyTo) {
100102
$body['substitution_data']['reply_to'] = $replyTo;
101103
}

0 commit comments

Comments
 (0)