Differential D15884 Diff 38390 src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php
Show First 20 Lines • Show All 2,691 Lines • ▼ Show 20 Lines | /* -( Sending Mail )------------------------------------------------------- */ | ||||
} | } | ||||
/** | /** | ||||
* @task mail | * @task mail | ||||
*/ | */ | ||||
protected function addHeadersAndCommentsToMailBody( | protected function addHeadersAndCommentsToMailBody( | ||||
PhabricatorMetaMTAMailBody $body, | PhabricatorMetaMTAMailBody $body, | ||||
array $xactions) { | array $xactions, | ||||
$object_label = null, | |||||
$object_href = null) { | |||||
$headers = array(); | $headers = array(); | ||||
$comments = array(); | $comments = array(); | ||||
foreach ($xactions as $xaction) { | foreach ($xactions as $xaction) { | ||||
if ($xaction->shouldHideForMail($xactions)) { | if ($xaction->shouldHideForMail($xactions)) { | ||||
continue; | continue; | ||||
} | } | ||||
$header = $xaction->getTitleForMail(); | $header = $xaction->getTitleForMail(); | ||||
if ($header !== null) { | if ($header !== null) { | ||||
$headers[] = $header; | $headers[] = $header; | ||||
} | } | ||||
$comment = $xaction->getBodyForMail(); | $comment = $xaction->getBodyForMail(); | ||||
if ($comment !== null) { | if ($comment !== null) { | ||||
$comments[] = $comment; | $comments[] = $comment; | ||||
} | } | ||||
} | } | ||||
$body->addRawSection(implode("\n", $headers)); | |||||
$headers_text = implode("\n", $headers); | |||||
$body->addRawPlaintextSection($headers_text); | |||||
$headers_html = phutil_implode_html(phutil_tag('br'), $headers); | |||||
$header_button = null; | |||||
if ($object_label !== null) { | |||||
$button_style = array( | |||||
'text-decoration: none;', | |||||
'padding: 4px 8px;', | |||||
'margin: 0 8px;', | |||||
'float: right;', | |||||
'color: #464C5C;', | |||||
'font-weight: bold;', | |||||
'border-radius: 3px;', | |||||
'background-color: #F7F7F9;', | |||||
'background-image: linear-gradient(to bottom,#fff,#f1f0f1);', | |||||
'border: 1px solid rgba(71,87,120,.2);', | |||||
); | |||||
$header_button = phutil_tag( | |||||
'a', | |||||
array( | |||||
'style' => implode(' ', $button_style), | |||||
'href' => $object_href, | |||||
), | |||||
$object_label); | |||||
} | |||||
$xactions_style = array( | |||||
'padding: 0 0 8px 0;', | |||||
); | |||||
$headers_html = phutil_tag( | |||||
'div', | |||||
array( | |||||
'style' => implode(' ', $xactions_style), | |||||
), | |||||
$headers_html); | |||||
$header_style = array( | |||||
'overflow: hidden;', | |||||
); | |||||
$headers_html = phutil_tag( | |||||
'div', | |||||
array( | |||||
'style' => implode(' ', $header_style), | |||||
), | |||||
array( | |||||
$header_button, | |||||
$headers_html, | |||||
)); | |||||
$body->addRawHTMLSection($headers_html); | |||||
foreach ($comments as $comment) { | foreach ($comments as $comment) { | ||||
$body->addRemarkupSection(null, $comment); | $body->addRemarkupSection(null, $comment); | ||||
} | } | ||||
} | } | ||||
/** | /** | ||||
* @task mail | * @task mail | ||||
▲ Show 20 Lines • Show All 825 Lines • Show Last 20 Lines |