diff --git a/README.md b/README.md index d745b630..bc434f6c 100644 --- a/README.md +++ b/README.md @@ -105,6 +105,7 @@ $messaging->send($message); - [x] [Sinch](https://www.sinch.com/) - [x] [Seven](https://www.seven.io/) - [ ] [SmsGlobal](https://www.smsglobal.com/) +- [x] [BulkSMS](https://www.bulksms.com/) ### Push - [x] [FCM](https://firebase.google.com/docs/cloud-messaging) diff --git a/src/Utopia/Messaging/Adapters/SMS/BulkSMS.php b/src/Utopia/Messaging/Adapters/SMS/BulkSMS.php new file mode 100644 index 00000000..68e594cd --- /dev/null +++ b/src/Utopia/Messaging/Adapters/SMS/BulkSMS.php @@ -0,0 +1,53 @@ +request( + method: 'POST', + url: "https://api.bulksms.com/v1/messages?auto-unicode=true&longMessageMaxParts=30", + headers: [ + 'content-type: application/json', + 'Authorization: Basic '.base64_encode("{$this->username}:{$this->password}") + ], + body: \json_encode([ + 'from' => $message->getFrom(), + 'to' => $message->getTo(), + 'body' => $message->getContent() + ]), + ); + } +} \ No newline at end of file diff --git a/tests/e2e/SMS/BulkSMSTest.php b/tests/e2e/SMS/BulkSMSTest.php new file mode 100644 index 00000000..310665bb --- /dev/null +++ b/tests/e2e/SMS/BulkSMSTest.php @@ -0,0 +1,14 @@ +markTestSkipped('Bulksms requires you to create an account in order to enable bulk SMS'); + } +}