Skip to content

Commit

Permalink
Fix Mteja Addon to handle HTTP request from callback service (ushahid…
Browse files Browse the repository at this point in the history
…i#4844)

* chore: update the http request handler

* chore: update Mteja ShortMessageController

---------

Co-authored-by: Mh-Asmi <[email protected]>
  • Loading branch information
webong and Mh-Asmi authored Mar 18, 2024
1 parent 5b947fd commit 911338e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/Ushahidi/Addons/Mteja/ShortMessageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,21 @@ class ShortMessageController extends DataSourceController
public function handleRequest(Request $request)
{
// Remove Non-Numeric characters because that's what the DB has
$from = preg_replace("/[^0-9,+.]/", "", $request->input('from'));
$from = preg_replace("/[^0-9,+.]/", "", $request->input('customerNumber'));

$this->save([
'type' => MessageType::SMS,
'from' => $from,
'contact_type' => Contact::PHONE,
'message' => $request->input('text'),
'to' => $request->input('to'),
'to' => $request->input('virtualNumber'),
'title' => null,
'datetime' => null,
'data_source_message_id' => "mteja-" . UUID::uuid4()->toString(),
'datetime' => $request->input('date'),
'data_source_message_id' => $request->input('atSmsId', UUID::uuid4()->toString()),
'data_source' => 'mteja',
'additional_data' => [
'fieldName' => $request->input('fieldName'),
'questionText' => $request->input('questionText')
'appId' => $request->input('appId'),
// 'questionText' => $request->input('questionText')
]
]);

Expand Down

0 comments on commit 911338e

Please sign in to comment.