mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-19 12:00:55 +01:00
Add email preference links to email footers
Summary: Ref T1217, Add link to email preferences to email template Test Plan: Add comment to object like Maniphest task, check that email has a footer with a link to email preferences. Reviewers: epriestley, #blessed_reviewers Reviewed By: epriestley, #blessed_reviewers Subscribers: Korvin, epriestley Maniphest Tasks: T1217 Differential Revision: https://secure.phabricator.com/D10883
This commit is contained in:
parent
6dc29724e7
commit
f7aa87311a
3 changed files with 33 additions and 1 deletions
|
@ -98,6 +98,12 @@ from replying. However, it may also cause deliverability issues -- notably, you
|
||||||
currently can not send this header via Amazon SES, and enabling this option with
|
currently can not send this header via Amazon SES, and enabling this option with
|
||||||
SES will prevent delivery of any affected mail.
|
SES will prevent delivery of any affected mail.
|
||||||
EODOC
|
EODOC
|
||||||
|
));
|
||||||
|
|
||||||
|
$email_preferences_description = $this->deformat(pht(<<<EODOC
|
||||||
|
You can disable the email preference link in emails if users prefer smaller
|
||||||
|
emails.
|
||||||
|
EODOC
|
||||||
));
|
));
|
||||||
|
|
||||||
$re_prefix_description = $this->deformat(pht(<<<EODOC
|
$re_prefix_description = $this->deformat(pht(<<<EODOC
|
||||||
|
@ -257,6 +263,14 @@ EODOC
|
||||||
))
|
))
|
||||||
->setSummary(pht('Show "To:" and "Cc:" footer hints in email.'))
|
->setSummary(pht('Show "To:" and "Cc:" footer hints in email.'))
|
||||||
->setDescription($recipient_hints_description),
|
->setDescription($recipient_hints_description),
|
||||||
|
$this->newOption('metamta.email-preferences', 'bool', true)
|
||||||
|
->setBoolOptions(
|
||||||
|
array(
|
||||||
|
pht('Show Email Preferences Link'),
|
||||||
|
pht('No Email Preferences Link'),
|
||||||
|
))
|
||||||
|
->setSummary(pht('Show email preferences link in email.'))
|
||||||
|
->setDescription($email_preferences_description),
|
||||||
$this->newOption('metamta.precedence-bulk', 'bool', false)
|
$this->newOption('metamta.precedence-bulk', 'bool', false)
|
||||||
->setBoolOptions(
|
->setBoolOptions(
|
||||||
array(
|
array(
|
||||||
|
|
|
@ -179,6 +179,23 @@ final class PhabricatorMetaMTAMailBody {
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add a section with a link to email preferences.
|
||||||
|
*
|
||||||
|
* @return this
|
||||||
|
* @task compose
|
||||||
|
*/
|
||||||
|
public function addEmailPreferenceSection() {
|
||||||
|
if (!PhabricatorEnv::getEnvConfig('metamta.email-preferences')) {
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
$href = PhabricatorEnv::getProductionURI(
|
||||||
|
'/settings/panel/emailpreferences/');
|
||||||
|
$this->addLinkSection(pht('EMAIL PREFERENCES'), $href);
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add an attachment.
|
* Add an attachment.
|
||||||
|
|
|
@ -1899,6 +1899,8 @@ abstract class PhabricatorApplicationTransactionEditor
|
||||||
$body->addReplySection($reply_section);
|
$body->addReplySection($reply_section);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$body->addEmailPreferenceSection();
|
||||||
|
|
||||||
$template
|
$template
|
||||||
->setFrom($this->getActingAsPHID())
|
->setFrom($this->getActingAsPHID())
|
||||||
->setSubjectPrefix($this->getMailSubjectPrefix())
|
->setSubjectPrefix($this->getMailSubjectPrefix())
|
||||||
|
@ -2013,7 +2015,6 @@ abstract class PhabricatorApplicationTransactionEditor
|
||||||
throw new Exception('Capability not supported.');
|
throw new Exception('Capability not supported.');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @task mail
|
* @task mail
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in a new issue