Differential D9375 Diff 24738 src/applications/metamta/management/PhabricatorMailManagementSendTestWorkflow.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/metamta/management/PhabricatorMailManagementSendTestWorkflow.php
| Show First 20 Lines • Show All 99 Lines • ▼ Show 20 Lines | foreach ($ccs as $key => $username) { | ||||
| pht("No such user '%s' exists.", $username)); | pht("No such user '%s' exists.", $username)); | ||||
| } | } | ||||
| $ccs[$key] = $users[$username]->getPHID(); | $ccs[$key] = $users[$username]->getPHID(); | ||||
| } | } | ||||
| $subject = $args->getArg('subject'); | $subject = $args->getArg('subject'); | ||||
| $tags = $args->getArg('tag'); | $tags = $args->getArg('tag'); | ||||
| $attach = $args->getArg('attach'); | $attach = $args->getArg('attach'); | ||||
| $is_html = $args->getArg('html'); | |||||
| $is_bulk = $args->getArg('bulk'); | $is_bulk = $args->getArg('bulk'); | ||||
| $console->writeErr("%s\n", pht('Reading message body from stdin...')); | $console->writeErr("%s\n", pht('Reading message body from stdin...')); | ||||
| $body = file_get_contents('php://stdin'); | $body = file_get_contents('php://stdin'); | ||||
| $mail = id(new PhabricatorMetaMTAMail()) | $mail = id(new PhabricatorMetaMTAMail()) | ||||
| ->addTos($tos) | ->addTos($tos) | ||||
| ->addCCs($ccs) | ->addCCs($ccs) | ||||
| ->setSubject($subject) | ->setSubject($subject) | ||||
| ->setBody($body) | ->setBody($body) | ||||
| ->setIsHTML($is_html) | |||||
| ->setIsBulk($is_bulk) | ->setIsBulk($is_bulk) | ||||
| ->setMailTags($tags); | ->setMailTags($tags); | ||||
| if ($args->getArg('html')) { | |||||
| $mail->setBody( | |||||
epriestley: Maybe something like:
pht('(This is a placeholder plaintext email body for a test message… | |||||
| pht('(This is a placeholder plaintext email body for a test message '. | |||||
| 'sent with --html.)')); | |||||
| $mail->setHTMLBody($body); | |||||
| } else { | |||||
| $mail->setBody($body); | |||||
| } | |||||
| if ($from) { | if ($from) { | ||||
| $mail->setFrom($from->getPHID()); | $mail->setFrom($from->getPHID()); | ||||
| } | } | ||||
| foreach ($attach as $attachment) { | foreach ($attach as $attachment) { | ||||
| $data = Filesystem::readFile($attachment); | $data = Filesystem::readFile($attachment); | ||||
| $name = basename($attachment); | $name = basename($attachment); | ||||
| $mime = Filesystem::getMimeType($attachment); | $mime = Filesystem::getMimeType($attachment); | ||||
| Show All 14 Lines | |||||
Maybe something like:
pht('(This is a placeholder plaintext email body for a test message sent with --html.)');