Skip to main content

Notification Templates

This section covers the API endpoints for managing notification templates in the admin panel.

List Templates

GET /v1/admin/notification-template

Returns a list of notification templates with pagination support.

Query Parameters

ParameterTypeDescriptionValidation Rules
search_textstringSearch in template titlesOptional
per_pageintegerNumber of items per pageOptional, default: 10
listbooleanReturn all templates without paginationOptional

Response

{
"success": true,
"message": "تم جلب البيانات بنجاح.",
"data": {
"current_page": 1,
"first_page_url": "http://testing-api.sumaya369.net/v1/admin/notifications-template?page=1",
"from": 1,
"last_page": 1,
"last_page_url": "http://testing-api.sumaya369.net/v1/admin/notifications-template?page=1",
"links": [
{
"url": null,
"label": "« السابق",
"active": false
},
{
"url": "http://testing-api.sumaya369.net/v1/admin/notifications-template?page=1",
"label": "1",
"active": true
},
{
"url": null,
"label": "التالي »",
"active": false
}
],
"next_page_url": null,
"path": "http://testing-api.sumaya369.net/v1/admin/notifications-template",
"per_page": 10,
"prev_page_url": null,
"to": 7,
"total": 7,
"notifications_template": [
{
"id": "aefe7bf0-b090-11ef-81e7-11345db79cfc",
"title": "دورة جديدة",
"url": null,
"icon": "second_icon",
"notification_icon": "https://sumaya-lms-backend-testing.s3.us-east-2.amazonaws.com/front-end/images/BGu1UMZv1cNagtkQ1G2dvvPp5DIOL4LBToJ7html.svg",
"notice_count": 1,
"notice_date": "2024-12-02",
"customers": "جميع المستخدمون النشطون",
"customers_count": 67638
},
{
"id": "56ee3920-32dc-11ef-8451-05aaa33d5eec",
"title": "الاول",
"url": null,
"icon": "second_icon",
"notification_icon": "https://sumaya-lms-backend-testing.s3.us-east-2.amazonaws.com/front-end/images/BGu1UMZv1cNagtkQ1G2dvvPp5DIOL4LBToJ7html.svg",
"notice_count": 0,
"notice_date": "2024-06-25",
"customers": "بعض المستخدمين ",
"customers_count": 1
},
{
"id": "11395f70-a7c5-11ee-93f3-4184744e90d4",
"title": "استعد لإطلاق نوايا 2024",
"url": "https://sumaya369.net/end-year",
"icon": "fifth_icon",
"notification_icon": "https://sumaya-lms-backend-testing.s3.us-east-2.amazonaws.com/front-end/images/hZ8xNU06UiUKFyGQMC7JpaAPuHPj4QbAqU8ofD7g.svg",
"notice_count": 1,
"notice_date": "2023-12-31",
"customers": "قفزة 2024",
"customers_count": 1852
},
{
"id": "6ec104c0-8a19-11ed-8dac-dd2ec8ca8269",
"title": "إشعار صيانة الموقع",
"url": null,
"icon": "fifth_icon",
"notification_icon": "https://sumaya-lms-backend-testing.s3.us-east-2.amazonaws.com/front-end/images/hZ8xNU06UiUKFyGQMC7JpaAPuHPj4QbAqU8ofD7g.svg",
"notice_count": 1,
"notice_date": "2023-01-02",
"customers": "جميع المستخدمون النشطون",
"customers_count": 67638
},
{
"id": "1ad6d290-37ed-11ed-b1a6-25c5a9fcdbfe",
"title": "فحص الاشعار",
"url": null,
"icon": "fifth_icon",
"notification_icon": "https://sumaya-lms-backend-testing.s3.us-east-2.amazonaws.com/front-end/images/hZ8xNU06UiUKFyGQMC7JpaAPuHPj4QbAqU8ofD7g.svg",
"notice_count": 5,
"notice_date": "2022-09-19",
"customers": "maz try notifi",
"customers_count": 2
},
{
"id": "8f92a760-34da-11ed-b491-332226370b58",
"title": "حالة اشتراكك",
"url": "https://sumaya369.net/courses/2213ba00-34da-11ed-9d8c-073ba59d48ac",
"icon": "seventh_icon",
"notification_icon": "https://sumaya-lms-backend-testing.s3.us-east-2.amazonaws.com/front-end/images/Yk7CTN8CBHaHvrZWZacULXJHsmqySJMDnRCAr8VX.svg",
"notice_count": 3,
"notice_date": "2022-09-15",
"customers": "مادة",
"customers_count": 1
},
{
"id": "8ea0e100-1d33-11ed-8fd8-0f345d84ffb1",
"title": "تنبيه : تسجيل دخول باكثر من جهاز",
"url": "https://sumaya369.net/auth/signup",
"icon": "fifth_icon",
"notification_icon": "https://sumaya-lms-backend-testing.s3.us-east-2.amazonaws.com/front-end/images/hZ8xNU06UiUKFyGQMC7JpaAPuHPj4QbAqU8ofD7g.svg",
"notice_count": 7,
"notice_date": "2022-08-16",
"customers": "بعض المستخدمين ",
"customers_count": 1
}
]
},
"status_code": 200
}

Get Template Details

GET /v1/admin/notification-template/{id}

Returns details of a specific notification template.

Response

{
"success": true,
"message": "تم جلب البيانات بنجاح.",
"data": {
"id": "aefe7bf0-b090-11ef-81e7-11345db79cfc",
"title": "دورة جديدة",
"description": "دوة الاختبار الجديد",
"url": null,
"icon": "second_icon",
"notification_icon": "https://sumaya-lms-backend-testing.s3.us-east-2.amazonaws.com/front-end/images/BGu1UMZv1cNagtkQ1G2dvvPp5DIOL4LBToJ7html.svg",
"meta": {
"type": "active_customers"
},
"notice_count": 1,
"notice_date": "2024-12-02 12:34:12"
},
"status_code": 200
}

Create Template

POST /v1/admin/notification-template

Creates a new notification template.

Request Body

ParameterTypeDescriptionValidation Rules
titlestringTemplate titleRequired, min: 3
descriptionstringTemplate descriptionRequired, min: 3
iconstringTemplate iconRequired, min: 3, values: first_icon,second_icon,third_icon,fourth_icon,fifth_icon,sixth_icon,seventh_icon
urlstringTemplate URLOptional, valid URL format
metaobjectAdditional metadataRequired
meta.typestringNotification typeRequired, values: active_customers,some_customers,special_product,has_active_subscription,active_customers_this_month
meta.some_customers_targetarrayTarget customer IDsRequired if type is some_customers
meta.special_product_idstringProduct IDRequired if type is special_product
meta.special_product_typestringProduct typeRequired if type is special_product, values: course,bundle
meta.fromstringStart dateOptional, format: Y-m-d
meta.tostringEnd dateOptional, format: Y-m-d

Response

{
"success": true,
"message": "تم حفظ البيانات بنجاح.",
"data": {
"id": "2a04c1a0-07f1-11f0-87fe-23f0e6dac6bd",
"title": "نموذج الإشعار",
"description": "نموذج الإشعار",
"url": null,
"icon": "first_icon",
"notification_icon": "https://sumaya-lms-backend-testing.s3.us-east-2.amazonaws.com/front-end/images/nFyrmm8aE9vFQb4q9aZtTFn6vjm1ZAljl54AKFzB.svg",
"meta": {
"type": "has_active_subscription",
"from": "2023-01-01",
"to": "2023-01-12"
},
"notice_count": null,
"notice_date": "2025-03-23 17:14:03"
},
"status_code": 200
}

Update Template

PATCH /v1/admin/notification-template/{id}

Updates an existing notification template.

Request Body

ParameterTypeDescriptionValidation Rules
titlestringTemplate titlemin: 3
descriptionstringTemplate descriptionmin: 3
iconstringTemplate iconvalues: first_icon,second_icon,third_icon,fourth_icon,fifth_icon,sixth_icon,seventh_icon
urlstringTemplate URLvalid URL format
metaobjectAdditional metadataOptional
meta.typestringNotification typeRequired with meta, values: active_customers,some_customers,special_product,has_active_subscription,active_customers_this_month
meta.some_customers_targetarrayTarget customer IDsRequired if type is some_customers
meta.special_product_idstringProduct IDRequired if type is special_product
meta.special_product_typestringProduct typeRequired if type is special_product, values: course,bundle
meta.fromstringStart dateformat: Y-m-d
meta.tostringEnd dateformat: Y-m-d

Response

{
"success": true,
"message": "تم تحديث البيانات بنجاح.",
"data": {
"id": "2a04c1a0-07f1-11f0-87fe-23f0e6dac6bd",
"title": "aaffgfcsdasd",
"description": "نموذج الإشعار",
"url": null,
"icon": "first_icon",
"notification_icon": "https://sumaya-lms-backend-testing.s3.us-east-2.amazonaws.com/front-end/images/nFyrmm8aE9vFQb4q9aZtTFn6vjm1ZAljl54AKFzB.svg",
"meta": {
"type": "has_active_subscription",
"from": "2023-01-01",
"to": "2023-01-12"
},
"notice_count": 0,
"notice_date": "2025-03-23 17:14:03"
},
"status_code": 200
}

Delete Templates

DELETE /v1/admin/notification-template

Deletes multiple notification templates by their IDs.

Request Body

ParameterTypeDescriptionValidation Rules
idsarrayArray of template IDs to deleteRequired
ids.*stringTemplate UUIDRequired, UUID format

Response

{
"success": true,
"message": "تم حذف البيانات بنجاح.",
"data": null,
"status_code": 200
}

Send Notifications

PATCH /v1/admin/send-notifications-template

Sends notifications for selected templates.

Request Body

ParameterTypeDescriptionValidation Rules
idsarrayArray of template IDs to sendRequired
ids.*stringTemplate UUIDRequired, UUID format

Response

{
"success": true,
"message": "تم ارسال الإشعارات بنجاح.",
"data": null,
"status_code": 200
}

Get Notification Types

GET /v1/admin/notifications-template-cases

Returns counts for different types of notification targets.

Response

{
"success": true,
"message": "تم جلب البيانات بنجاح.",
"data": {
"active_customers": "67.6K",
"has_active_subscription": "26.6K",
"active_customers_this_month": "163"
},
"status_code": 200
}

Notes

  • The list endpoint supports filtering by icon and trashed status
  • Results are sorted by creation date in descending order by default
  • Notification types:
    • active_customers: All active customers
    • some_customers: Specific selected customers
    • special_product: Related to a specific course or bundle
    • has_active_subscription: Customers with active subscriptions
    • active_customers_this_month: Customers active in current month
  • When sending notifications:
    • Notice count is incremented for each send
    • Notice date is updated to current time
    • Notifications are processed asynchronously via jobs