@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

HTML emails for Calendar event description changes should respect remarkup rules

Summary: Ref T7964, HTML emails for Calendar event description changes should respect remarkup rules

Test Plan: Create event and edit description, check that email has a correctly formatted remarkup description section.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: epriestley, Korvin

Maniphest Tasks: T7964

Differential Revision: https://secure.phabricator.com/D13554

+14 -15
+2 -2
src/applications/calendar/editor/PhabricatorCalendarEventEditor.php
··· 436 436 $body = parent::buildMailBody($object, $xactions); 437 437 438 438 if (strlen($description)) { 439 - $body->addTextSection( 439 + $body->addRemarkupSection( 440 440 pht('EVENT DESCRIPTION'), 441 - $object->getDescription()); 441 + $description); 442 442 } 443 443 444 444 $body->addLinkSection(
+10 -11
src/applications/metamta/view/PhabricatorMetaMTAMailBody.php
··· 43 43 return $this; 44 44 } 45 45 46 - public function addRemarkupSection($text) { 46 + public function addRemarkupSection($header, $text) { 47 47 try { 48 48 $engine = PhabricatorMarkupEngine::newMarkupEngine(array()); 49 49 $engine->setConfig('viewer', $this->getViewer()); 50 50 $engine->setMode(PhutilRemarkupEngine::MODE_TEXT); 51 51 $styled_text = $engine->markupText($text); 52 - $this->sections[] = $styled_text; 52 + $this->addPlaintextSection($header, $styled_text); 53 53 } catch (Exception $ex) { 54 54 phlog($ex); 55 - $this->sections[] = $text; 55 + $this->addTextSection($header, $text); 56 56 } 57 57 58 58 try { ··· 63 63 'uri.base', 64 64 PhabricatorEnv::getProductionURI('/')); 65 65 $html = $mail_engine->markupText($text); 66 - $this->htmlSections[] = $html; 66 + $this->addHTMLSection($header, $html); 67 67 } catch (Exception $ex) { 68 68 phlog($ex); 69 - $this->htmlSections[] = phutil_escape_html_newlines( 70 - phutil_tag( 71 - 'div', 72 - array(), 73 - $text)); 69 + $this->addHTMLSection($header, $text); 74 70 } 75 71 76 72 return $this; ··· 121 117 } 122 118 123 119 public function addHTMLSection($header, $html_fragment) { 120 + if ($header !== null) { 121 + $header = phutil_tag('strong', array(), $header); 122 + } 123 + 124 124 $this->htmlSections[] = array( 125 125 phutil_tag( 126 126 'div', 127 127 array(), 128 128 array( 129 - phutil_tag('strong', array(), $header), 129 + $header, 130 130 phutil_tag('div', array(), $html_fragment), 131 131 )), 132 132 ); ··· 212 212 private function indent($text) { 213 213 return rtrim(" ".str_replace("\n", "\n ", $text)); 214 214 } 215 - 216 215 }
+1 -1
src/applications/phortune/editor/PhortuneCartEditor.php
··· 145 145 "%s", 146 146 $issues); 147 147 148 - $body->addRemarkupSection($overview); 148 + $body->addRemarkupSection(null, $overview); 149 149 150 150 $body->addLinkSection( 151 151 pht('PAY NOW'),
+1 -1
src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php
··· 2668 2668 $body->addRawSection(implode("\n", $headers)); 2669 2669 2670 2670 foreach ($comments as $comment) { 2671 - $body->addRemarkupSection($comment); 2671 + $body->addRemarkupSection(null, $comment); 2672 2672 } 2673 2673 } 2674 2674