Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F93073544
PhabricatorSMSDemultiplexWorker.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
Tue, Nov 26, 00:22
Size
774 B
Mime Type
text/x-php
Expires
Thu, Nov 28, 00:22 (2 d)
Engine
blob
Format
Raw Data
Handle
22559385
Attached To
rPH Phabricator
PhabricatorSMSDemultiplexWorker.php
View Options
<?php
final
class
PhabricatorSMSDemultiplexWorker
extends
PhabricatorSMSWorker
{
protected
function
doWork
()
{
$viewer
=
PhabricatorUser
::
getOmnipotentUser
();
$task_data
=
$this
->
getTaskData
();
$to_numbers
=
idx
(
$task_data
,
'toNumbers'
);
if
(!
$to_numbers
)
{
// If we don't have any to numbers, don't send any sms.
return
;
}
foreach
(
$to_numbers
as
$number
)
{
// NOTE: we will set the fromNumber and the proper provider data
// in the `PhabricatorSMSSendWorker`.
$sms
=
PhabricatorSMS
::
initializeNewSMS
(
$task_data
[
'body'
]);
$sms
->
setToNumber
(
$number
);
$sms
->
save
();
$this
->
queueTask
(
'PhabricatorSMSSendWorker'
,
array
(
'smsID'
=>
$sms
->
getID
(),
));
}
}
}
Event Timeline
Log In to Comment