Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15369327
D10272.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D10272.diff
View Options
diff --git a/src/applications/metamta/management/PhabricatorMailManagementShowOutboundWorkflow.php b/src/applications/metamta/management/PhabricatorMailManagementShowOutboundWorkflow.php
--- a/src/applications/metamta/management/PhabricatorMailManagementShowOutboundWorkflow.php
+++ b/src/applications/metamta/management/PhabricatorMailManagementShowOutboundWorkflow.php
@@ -17,6 +17,12 @@
'help' => 'Show details about outbound mail with given ID.',
'repeat' => true,
),
+ array(
+ 'name' => 'dump-html',
+ 'help' => pht(
+ 'Dump the HTML body of the mail. You can redirect it to a '.
+ 'file and then open it in a browser.'),
+ ),
));
}
@@ -45,6 +51,20 @@
$last_key = last_key($messages);
foreach ($messages as $message_key => $message) {
+ if ($args->getArg('dump-html')) {
+ $html_body = $message->getHTMLBody();
+ if (strlen($html_body)) {
+ $template =
+ "<!doctype html><html><body>{$html_body}</body></html>";
+ $console->writeOut("%s\n", $html_body);
+ } else {
+ $console->writeErr(
+ "%s\n",
+ pht('(This message has no HTML body.)'));
+ }
+ continue;
+ }
+
$info = array();
$info[] = pht('PROPERTIES');
@@ -61,6 +81,10 @@
continue;
}
+ if ($key == 'html-body') {
+ continue;
+ }
+
if ($key == 'headers') {
continue;
}
@@ -110,8 +134,21 @@
}
$info[] = null;
- $info[] = pht('BODY');
- $info[] = $message->getBody();
+ $info[] = pht('TEXT BODY');
+ if (strlen($message->getBody())) {
+ $info[] = $message->getBody();
+ } else {
+ $info[] = pht('(This message has no text body.)');
+ }
+
+ $info[] = null;
+ $info[] = pht('HTML BODY');
+ if (strlen($message->getHTMLBody())) {
+ $info[] = $message->getHTMLBody();
+ $info[] = null;
+ } else {
+ $info[] = pht('(This message has no HTML body.)');
+ }
$console->writeOut('%s', implode("\n", $info));
diff --git a/src/applications/metamta/storage/PhabricatorMetaMTAMail.php b/src/applications/metamta/storage/PhabricatorMetaMTAMail.php
--- a/src/applications/metamta/storage/PhabricatorMetaMTAMail.php
+++ b/src/applications/metamta/storage/PhabricatorMetaMTAMail.php
@@ -221,6 +221,10 @@
return $this->getParam('body');
}
+ public function getHTMLBody() {
+ return $this->getParam('html-body');
+ }
+
public function setIsErrorEmail($is_error) {
$this->setParam('is-error', $is_error);
return $this;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Mar 13, 6:13 AM (2 w, 6 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7608224
Default Alt Text
D10272.diff (2 KB)
Attached To
Mode
D10272: Make HTML email a little easier to debug
Attached
Detach File
Event Timeline
Log In to Comment