Changeset View
Changeset View
Standalone View
Standalone View
src/applications/metamta/query/PhabricatorMetaMTAActor.php
Show All 14 Lines | final class PhabricatorMetaMTAActor extends Phobject { | ||||
const REASON_RESPONSE = 'response'; | const REASON_RESPONSE = 'response'; | ||||
const REASON_SELF = 'self'; | const REASON_SELF = 'self'; | ||||
const REASON_MAILTAGS = 'mailtags'; | const REASON_MAILTAGS = 'mailtags'; | ||||
const REASON_BOT = 'bot'; | const REASON_BOT = 'bot'; | ||||
const REASON_FORCE = 'force'; | const REASON_FORCE = 'force'; | ||||
const REASON_FORCE_HERALD = 'force-herald'; | const REASON_FORCE_HERALD = 'force-herald'; | ||||
const REASON_ROUTE_AS_NOTIFICATION = 'route-as-notification'; | const REASON_ROUTE_AS_NOTIFICATION = 'route-as-notification'; | ||||
const REASON_ROUTE_AS_MAIL = 'route-as-mail'; | const REASON_ROUTE_AS_MAIL = 'route-as-mail'; | ||||
const REASON_UNVERIFIED = 'unverified'; | |||||
private $phid; | private $phid; | ||||
private $emailAddress; | private $emailAddress; | ||||
private $name; | private $name; | ||||
private $status = self::STATUS_DELIVERABLE; | private $status = self::STATUS_DELIVERABLE; | ||||
private $reasons = array(); | private $reasons = array(); | ||||
private $isVerified = false; | |||||
public function setName($name) { | public function setName($name) { | ||||
$this->name = $name; | $this->name = $name; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function getName() { | public function getName() { | ||||
return $this->name; | return $this->name; | ||||
} | } | ||||
public function setEmailAddress($email_address) { | public function setEmailAddress($email_address) { | ||||
$this->emailAddress = $email_address; | $this->emailAddress = $email_address; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function getEmailAddress() { | public function getEmailAddress() { | ||||
return $this->emailAddress; | return $this->emailAddress; | ||||
} | } | ||||
public function setIsVerified($is_verified) { | |||||
$this->isVerified = $is_verified; | |||||
return $this; | |||||
} | |||||
public function getIsVerified() { | |||||
return $this->isVerified; | |||||
} | |||||
public function setPHID($phid) { | public function setPHID($phid) { | ||||
$this->phid = $phid; | $this->phid = $phid; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function getPHID() { | public function getPHID() { | ||||
return $this->phid; | return $this->phid; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 43 Lines • ▼ Show 20 Lines | $names = array( | ||||
self::REASON_SELF => pht('Self Mail'), | self::REASON_SELF => pht('Self Mail'), | ||||
self::REASON_MAIL_DISABLED => pht('Mail Disabled'), | self::REASON_MAIL_DISABLED => pht('Mail Disabled'), | ||||
self::REASON_MAILTAGS => pht('Mail Tags'), | self::REASON_MAILTAGS => pht('Mail Tags'), | ||||
self::REASON_UNLOADABLE => pht('Bad Recipient'), | self::REASON_UNLOADABLE => pht('Bad Recipient'), | ||||
self::REASON_FORCE => pht('Forced Mail'), | self::REASON_FORCE => pht('Forced Mail'), | ||||
self::REASON_FORCE_HERALD => pht('Forced by Herald'), | self::REASON_FORCE_HERALD => pht('Forced by Herald'), | ||||
self::REASON_ROUTE_AS_NOTIFICATION => pht('Route as Notification'), | self::REASON_ROUTE_AS_NOTIFICATION => pht('Route as Notification'), | ||||
self::REASON_ROUTE_AS_MAIL => pht('Route as Mail'), | self::REASON_ROUTE_AS_MAIL => pht('Route as Mail'), | ||||
self::REASON_UNVERIFIED => pht('Address Not Verified'), | |||||
); | ); | ||||
return idx($names, $reason, pht('Unknown ("%s")', $reason)); | return idx($names, $reason, pht('Unknown ("%s")', $reason)); | ||||
} | } | ||||
public static function getReasonDescription($reason) { | public static function getReasonDescription($reason) { | ||||
$descriptions = array( | $descriptions = array( | ||||
self::REASON_NONE => pht( | self::REASON_NONE => pht( | ||||
Show All 38 Lines | $descriptions = array( | ||||
'This recipient was added by a "Send me an Email" rule in Herald, '. | 'This recipient was added by a "Send me an Email" rule in Herald, '. | ||||
'which overrides some delivery settings.'), | 'which overrides some delivery settings.'), | ||||
self::REASON_ROUTE_AS_NOTIFICATION => pht( | self::REASON_ROUTE_AS_NOTIFICATION => pht( | ||||
'This message was downgraded to a notification by outbound mail '. | 'This message was downgraded to a notification by outbound mail '. | ||||
'rules in Herald.'), | 'rules in Herald.'), | ||||
self::REASON_ROUTE_AS_MAIL => pht( | self::REASON_ROUTE_AS_MAIL => pht( | ||||
'This message was upgraded to email by outbound mail rules '. | 'This message was upgraded to email by outbound mail rules '. | ||||
'in Herald.'), | 'in Herald.'), | ||||
self::REASON_UNVERIFIED => pht( | |||||
'This recipient does not have a verified primary email address.'), | |||||
); | ); | ||||
return idx($descriptions, $reason, pht('Unknown Reason ("%s")', $reason)); | return idx($descriptions, $reason, pht('Unknown Reason ("%s")', $reason)); | ||||
} | } | ||||
} | } |