Skip to content

Commit

Permalink
Fix Mteja Addon to handle HTTP request from callback service (#4844)
Browse files Browse the repository at this point in the history
* chore: update the http request handler

* chore: update Mteja ShortMessageController

---------

Co-authored-by: Mh-Asmi <mnaasmi@gmail.com>
  • Loading branch information
2 people authored and tuxpiper committed Mar 18, 2024
1 parent 6d715ff commit a1b8fdf
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 a1b8fdf

Please sign in to comment.