1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-24 06:20:56 +01:00

Allow MetaMTAMail to send with a raw "From" address

Summary:
Ref T7607. Ref T7522.

  - For the import tools, I want to send from "Phacility Support <support@phacility.com>".
  - In the general case, I want to send billing mail from merchants (T7607) later on.

Test Plan: Sent an email and saw the desired "From" address.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T7607, T7522

Differential Revision: https://secure.phabricator.com/D12100
This commit is contained in:
epriestley 2015-03-17 14:43:21 -07:00
parent 827c0ce081
commit 66075708d0

View file

@ -206,6 +206,11 @@ final class PhabricatorMetaMTAMail extends PhabricatorMetaMTADAO {
return $this;
}
public function setRawFrom($raw_email, $raw_name) {
$this->setParam('raw-from', array($raw_email, $raw_name));
return $this;
}
public function setReplyTo($reply_to) {
$this->setParam('reply-to', $reply_to);
return $this;
@ -430,6 +435,10 @@ final class PhabricatorMetaMTAMail extends PhabricatorMetaMTADAO {
foreach ($params as $key => $value) {
switch ($key) {
case 'raw-from':
list($from_email, $from_name) = $value;
$mailer->setFrom($from_email, $from_name);
break;
case 'from':
$from = $value;
$actor_email = null;