Skip to content

Send Notification

Send a custom notification using a specific notificator.

Request

php
use ThingsTelemetry\Traccar\Dto\NotificationMessageData;
use ThingsTelemetry\Traccar\Facades\Notification;

$result = Notification::send(
    notificator: 'mail',
    message: new NotificationMessageData(
        body: 'Hello team',
        subject: 'Alert',
    ),
    userIds: [1, 2],
);

Parameters

ParameterTypeDescription
notificatorstringRequired. Notificator type (e.g., "mail", "telegram").
messageNotificationMessageDataRequired. The message to send.
userIdsarray<int>Optional. List of user IDs. If omitted, sends to all users permitted for current user.

Result

Returns ThingsTelemetry\Traccar\Dto\StatusData.

Released under the MIT License.