PHPackages                             wacky159/laravel-notification-channel-telenor-mm - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Mail &amp; Notifications](/categories/mail)
4. /
5. wacky159/laravel-notification-channel-telenor-mm

ActiveLibrary[Mail &amp; Notifications](/categories/mail)

wacky159/laravel-notification-channel-telenor-mm
================================================

A Laravel Notification Channel for Telenor MM (ATOM) SMS API

v1.5.0(1y ago)024MITPHPPHP &gt;=8.1

Since Dec 2Pushed 1y ago1 watchersCompare

[ Source](https://github.com/wacky159/laravel-notification-channel-telenor-mm)[ Packagist](https://packagist.org/packages/wacky159/laravel-notification-channel-telenor-mm)[ Docs](https://github.com/wacky159/laravel-notification-channel-telenor-mm)[ RSS](/packages/wacky159-laravel-notification-channel-telenor-mm/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (5)Versions (9)Used By (0)

Laravel Telenor MM Notification Channel
=======================================

[](#laravel-telenor-mm-notification-channel)

[![Latest Version on Packagist](https://camo.githubusercontent.com/f9091619326c0afc6b190ebacbf765f5c36c62ca0673e33543309637b85e56fe/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7761636b793135392f6c61726176656c2d6e6f74696669636174696f6e2d6368616e6e656c2d74656c656e6f722d6d6d2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/wacky159/laravel-notification-channel-telenor-mm)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Total Downloads](https://camo.githubusercontent.com/bbf964ff4f7b6ceec56286887a9e4a49ff2aee14ec4d7371eca4f73bb208c4a9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7761636b793135392f6c61726176656c2d6e6f74696669636174696f6e2d6368616e6e656c2d74656c656e6f722d6d6d2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/wacky159/laravel-notification-channel-telenor-mm)

This package makes it easy to send notifications via [Telenor MM](https://www.linkedin.com/company/telenor-group/) (now known as ATOM in Myanmar) with Laravel 10.x.

Contents
--------

[](#contents)

- [Installation](#installation)
- [Configuration](#configuration)
- [Usage](#usage)
- [Available Methods](#available-methods)
- [Special Character Conversion](#special-character-conversion)
- [Testing](#testing)
- [Security](#security)
- [Contributing](#contributing)
- [License](#license)

Installation
------------

[](#installation)

You can install this package via Composer:

```
composer require wacky159/laravel-notification-channel-telenor-mm
```

Configuration
-------------

[](#configuration)

### Publish Configuration

[](#publish-configuration)

```
php artisan vendor:publish --provider="Wacky159\TelenorMM\TelenorMMServiceProvider"
```

### Environment Variables

[](#environment-variables)

Add the following to your `.env` file:

```
TELENOR_MM_CLIENT_ID=your-client-id
TELENOR_MM_CLIENT_SECRET=your-client-secret
TELENOR_MM_API_URL=https://prod-apigw.atom.com.mm  # ATOM (formerly Telenor MM) API endpoint in Myanmar
TELENOR_MM_CALLBACK_URL=your-callback-url

# Optional Settings
TELENOR_MM_TOKEN_TTL=3600
TELENOR_MM_AUTH_CODE_TTL=86400
TELENOR_MM_MAX_RETRY=3
TELENOR_MM_RETRY_DELAY=1
TELENOR_MM_LOG_ENABLED=false
TELENOR_MM_LOG_CHANNEL=stack
```

### Callback Setup

[](#callback-setup)

You need to implement a callback endpoint to handle the authorization response from Telenor MM. Here's an example:

```
namespace App\Http\Controllers;

use Illuminate\Http\Request;
use Wacky159\TelenorMM\Traits\HandleTelenorAuthorization;

class TelenorAuthController extends Controller
{
    use HandleTelenorAuthorization;

    public function callback(Request $request)
    {
        return $this->handleTelenorCallback($request);
    }
}
```

Then add the route in your `routes/web.php`:

```
Route::get('telenor/callback', [TelenorAuthController::class, 'callback'])->name('telenor.callback');
```

Make sure to set the `TELENOR_MM_CALLBACK_URL` in your `.env` file to match this route:

```
TELENOR_MM_CALLBACK_URL=https://your-domain.com/telenor/callback
```

Usage
-----

[](#usage)

### Create a Notification

[](#create-a-notification)

```
class TestNotification extends Notification
{
    public function toTelenorMM($notifiable): ?TelenorMMMessage
    {
        // Get phone number from routes array (for Notification::route usage)
        // or from the notifiable model
        $phoneNumber = $notifiable->routes['telenorMM']
            ?? $notifiable->routeNotificationForTelenorMM();

        // Remove '+' prefix from phone number
        $phoneNumber = ltrim($phoneNumber, '+');

        if (empty($phoneNumber)) {
            return null;
        }

        return (new TelenorMMMessage())
            ->content('Hello World!')
            ->type(MessageType::TEXT)
            ->sender('YourApp', SenderType::ALPHANUMERIC->value)
            ->characteristic('UserName', 'your-username')
            ->characteristic('Password', 'your-password')
            ->receiver($phoneNumber, ReceiverType::INTERNATIONAL->value);
    }
}
```

### Required Fields

[](#required-fields)

When creating a TelenorMMMessage, the following fields are required:

1. `content`: Message content
2. `type`: Message type
3. `characteristic`: Must include these two characteristics
    - `UserName`: Username
    - `Password`: Password
4. `sender`:
    - `name`: Sender name
    - `@type`: Sender type
5. `receiver`: At least one receiver, and each receiver must include
    - `phoneNumber`: Receiver phone number
    - `@type`: Receiver type

### Send Notification

[](#send-notification)

```
$user->notify(new TestNotification());

\Illuminate\Support\Facades\Notification::route('telenorMM', 'customer-phone-number')->notify(new TestNotification);
```

Available Methods
-----------------

[](#available-methods)

### TelenorMMMessage

[](#telenormmmessage)

- `content($message, $encode = true)`: Set message content. The second parameter `$encode` is optional and defaults to `true`. If set to `false`, special characters will not be automatically encoded.
- `type($type)`: Set message type (TEXT, BINARY, MULTILINGUAL, FLASH)
- `sender($name, $type = 5)`: Set sender name and type
- `receiver($phoneNumber, $type = 1)`: Set receiver phone number and type
    - `$type = 0`: Unknown type
    - `$type = 1`: International number (default)
    - `$type = 2`: National number
    - `$type = 3`: Network specific number
    - `$type = 4`: Subscriber number
    - `$type = 5`: Alphanumeric
    - `$type = 6`: Short code

### Receiver Type Examples

[](#receiver-type-examples)

```
use Wacky159\TelenorMM\Enums\ReceiverType;

// Use international number as receiver (default)
$message->receiver('+886912345678', ReceiverType::INTERNATIONAL);

// Use national number as receiver
$message->receiver('0912345678', ReceiverType::NATIONAL);

// Use subscriber number as receiver
$message->receiver('SUB123', ReceiverType::SUBSCRIBER_NUMBER);

// Can add multiple receivers
$message
    ->receiver('+886912345678', ReceiverType::INTERNATIONAL)
    ->receiver('0912345678', ReceiverType::NATIONAL);
```

### Message Types

[](#message-types)

Use MessageType enum to specify message type:

```
use Wacky159\TelenorMM\Enums\MessageType;

$message->type(MessageType::TEXT);    // Text message
$message->type(MessageType::BINARY);  // Binary message
$message->type(MessageType::MULTILINGUAL); // Multilingual message
$message->type(MessageType::FLASH);   // Flash message
```

### Debug Logging

[](#debug-logging)

Enable debug logging:

```
TELENOR_MM_LOG_ENABLED=true
TELENOR_MM_LOG_CHANNEL=daily
```

Special Character Conversion
----------------------------

[](#special-character-conversion)

This package provides a helper function to handle special character conversion for SMS messages. You can use it in several ways:

### Basic Usage

[](#basic-usage)

```
// Basic conversion with default character mapping
$converted = convert_special_characters('Hello World!')->convert();

// Using string casting
$converted = (string) convert_special_characters('Hello World!');
```

### Custom Character Mapping

[](#custom-character-mapping)

You can customize the character mapping using the fluent interface:

```
// Custom mapping for specific characters
$converted = convert_special_characters('Hello World!')
    ->map([
        ' ' => '_',
        '!' => '-EXCLAIM-'
    ])
    ->convert();
```

### Using in Your Notification

[](#using-in-your-notification)

```
public function toTelenorMM($notifiable)
{
    return TelenorMMMessage::create()
        ->content('Hello World! Special chars: @#$%')
        ->type(MessageType::TEXT);
}
```

### Extending the Converter

[](#extending-the-converter)

You can also extend the conversion logic by creating your own converter class:

```
use Wacky159\TelenorMM\Support\HasSpecialCharacterConversion;

class MyCustomConverter
{
    use HasSpecialCharacterConversion;

    public function __construct()
    {
        // Define your custom mapping
        $this->setSpecialCharacterMapping([
            '@' => '[at]',
            '#' => '[hash]'
        ]);
    }

    // Optionally override the conversion logic
    public function convertSpecialCharacters(string $content): string
    {
        // Your custom conversion logic here
        return parent::convertSpecialCharacters($content);
    }
}
```

### Automatic Encoding in TelenorMMMessage

[](#automatic-encoding-in-telenormmmessage)

By default, `TelenorMMMessage::content()` will automatically encode special characters for TEXT type messages. You can disable this behavior by passing `false` as the second parameter: `->content($message, false)`.

```
public function toTelenorMM($notifiable)
{
    return TelenorMMMessage::create()
        // Default behavior: automatically encode special characters
        ->content('Hello World! Special chars: @#$%')
        // Or disable automatic encoding
        ->content('Hello World! Special chars: @#$%', false)
        ->type(MessageType::TEXT);
}
```

Testing
-------

[](#testing)

```
composer test
```

Security
--------

[](#security)

If you discover any security-related issues, please email  instead of using the issue tracker.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance39

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

8

Last Release

525d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0e990385bd15f33253704a4b6d6f0e8e96f182b5ffab6776bcd06fc30309cda6?d=identicon)[wacky159](/maintainers/wacky159)

---

Tags

laravelatomnotificationtelenormm

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/wacky159-laravel-notification-channel-telenor-mm/health.svg)

```
[![Health](https://phpackages.com/badges/wacky159-laravel-notification-channel-telenor-mm/health.svg)](https://phpackages.com/packages/wacky159-laravel-notification-channel-telenor-mm)
```

###  Alternatives

[laravel-notification-channels/telegram

Telegram Notifications Channel for Laravel

1.1k3.4M35](/packages/laravel-notification-channels-telegram)[laravel-notification-channels/twilio

Provides Twilio notification channel for Laravel

2587.7M12](/packages/laravel-notification-channels-twilio)[laravel-notification-channels/discord

Laravel notification driver for Discord.

2371.3M11](/packages/laravel-notification-channels-discord)[s-ichikawa/laravel-sendgrid-driver

This library adds a 'sendgrid' mail driver to Laravel.

4139.3M1](/packages/s-ichikawa-laravel-sendgrid-driver)[ghanem/laravel-smsmisr

Send SMS and SMS Notification via SMS Misr for Laravel

194.8k](/packages/ghanem-laravel-smsmisr)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
