Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F103284238
PhabricatorSMSManagementSendTestWorkflow.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Fri, Feb 28, 20:38
Size
1 KB
Mime Type
text/x-php
Expires
Sun, Mar 2, 20:38 (2 d)
Engine
blob
Format
Raw Data
Handle
24530070
Attached To
rPH Phabricator
PhabricatorSMSManagementSendTestWorkflow.php
View Options
<?php
final
class
PhabricatorSMSManagementSendTestWorkflow
extends
PhabricatorSMSManagementWorkflow
{
protected
function
didConstruct
()
{
$this
->
setName
(
'send-test'
)
->
setSynopsis
(
pht
(
'Simulate sending an SMS. This may be useful to test your SMS '
.
'configuration, or while developing new SMS adapters.'
))
->
setExamples
(
"**send-test** --to 12345678 --body 'pizza time yet?'"
)
->
setArguments
(
array
(
array
(
'name'
=>
'to'
,
'param'
=>
'number'
,
'help'
=>
pht
(
'Send SMS "To:" the specified number.'
),
'repeat'
=>
true
,
),
array
(
'name'
=>
'body'
,
'param'
=>
'text'
,
'help'
=>
pht
(
'Send SMS with the specified body.'
),
),
));
}
public
function
execute
(
PhutilArgumentParser
$args
)
{
$console
=
PhutilConsole
::
getConsole
();
$viewer
=
$this
->
getViewer
();
$tos
=
$args
->
getArg
(
'to'
);
$body
=
$args
->
getArg
(
'body'
);
PhabricatorWorker
::
setRunAllTasksInProcess
(
true
);
PhabricatorSMSImplementationAdapter
::
sendSMS
(
$tos
,
$body
);
$console
->
writeErr
(
"%s
\n\n
phabricator/ $ ./bin/sms list-outbound
\n\n
"
,
pht
(
'Send completed! You can view the list of SMS messages sent by '
.
'running this command:'
));
}
}
Event Timeline
Log In to Comment