Skip to content

Commit 213eea7

Browse files
zenaznepriestley
authored and
epriestley
committedMar 29, 2014
Fix Mailgun Reply-To handling
Summary: When sending the "Reply-To" header to Mailgun, Phabricator would previously send two headers for every "Reply-To": "Reply-To[0][email]" and "Reply-To[0][name]". Instead, explicitly build the header as specified by RFC 2822 and send it to Mailgun pre-baked. Pretty sure this bug was a cargo-cult from the Sendgrid code, where (apparently) this actually works. Test Plan: Triggered an email from Phabricator, saw that the header was sent properly. Reviewers: #blessed_reviewers, epriestley Reviewed By: #blessed_reviewers, epriestley Subscribers: epriestley, Korvin Differential Revision: https://secure.phabricator.com/D8645
1 parent cca5078 commit 213eea7

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed
 

‎src/applications/metamta/adapter/PhabricatorMailImplementationMailgunAdapter.php

+2-5
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,7 @@ public function addReplyTo($email, $name = '') {
1818
if (empty($this->params['reply-to'])) {
1919
$this->params['reply-to'] = array();
2020
}
21-
$this->params['reply-to'][] = array(
22-
'email' => $email,
23-
'name' => $name,
24-
);
21+
$this->params['reply-to'][] = "{$name} <{$email}>";
2522
return $this;
2623
}
2724

@@ -92,7 +89,7 @@ public function send() {
9289

9390
if (idx($this->params, 'reply-to')) {
9491
$replyto = $this->params['reply-to'];
95-
$params['h:reply-to'] = $replyto;
92+
$params['h:reply-to'] = implode(', ', $replyto);
9693
}
9794

9895
if (idx($this->params, 'ccs')) {

0 commit comments

Comments
 (0)
Failed to load comments.