mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 13:12:50 +01:00
Updates for readme
This commit is contained in:
parent
1f2d608742
commit
23fb0d4cda
@ -22,6 +22,11 @@ use Twilio\Rest\Client;
|
||||
class TwilioController extends BaseController
|
||||
{
|
||||
|
||||
private array $invalid_codes = [
|
||||
'+21',
|
||||
'+17152567760',
|
||||
];
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
@ -39,7 +44,7 @@ class TwilioController extends BaseController
|
||||
|
||||
$account = $user->company()->account;
|
||||
|
||||
if(stripos($request->phone, '+21') !== false) {
|
||||
if(!$this->checkPhoneValidity($request->phone)) {
|
||||
return response()->json(['message' => 'This phone number is not supported'], 400);
|
||||
}
|
||||
|
||||
@ -70,6 +75,19 @@ class TwilioController extends BaseController
|
||||
return response()->json(['message' => 'Code sent.'], 200);
|
||||
}
|
||||
|
||||
private function checkPhoneValidity($phone)
|
||||
{
|
||||
foreach($this->invalid_codes as $code){
|
||||
|
||||
if(stripos($phone, $code) !== false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
|
@ -305,14 +305,20 @@ class ProcessPostmarkWebhook implements ShouldQueue
|
||||
|
||||
if($sl) {
|
||||
$this->updateSystemLog($sl, $data);
|
||||
|
||||
if (config('ninja.notification.slack')) {
|
||||
$this->invitation->company->notification(new EmailSpamNotification($this->invitation->company->account))->ninja();
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
(new SystemLogger($data, SystemLog::CATEGORY_MAIL, SystemLog::EVENT_MAIL_SPAM_COMPLAINT, SystemLog::TYPE_WEBHOOK_RESPONSE, $this->invitation->contact->client, $this->invitation->company))->handle();
|
||||
|
||||
if (config('ninja.notification.slack')) {
|
||||
$this->invitation->company->notification(new EmailSpamNotification($this->invitation->company->account))->ninja();
|
||||
}
|
||||
if (config('ninja.notification.slack')) {
|
||||
$this->invitation->company->notification(new EmailSpamNotification($this->invitation->company->account))->ninja();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private function discoverInvitation($message_id)
|
||||
|
Loading…
Reference in New Issue
Block a user