sc_send_notification('title', 'message', 'destiny_type', 'to', 'from', 'link', 'dtexpire', 'profile')
|
|
The macro sc_send_notification allows sending notifications to system users dynamically.
Parameter Description
| Parameter |
Description |
Example |
title => |
Mandatory parameter that receives the title of the notification that will be sent.
The text can be provided in quotes, using variables or langs.
|
Using variable $title_not = "message title";
'title' => $title_not
Direct text in the macro or with lang
'title' => 'message title' or 'title' => {lang_notification_title}
|
message =>
|
Mandatory parameter that receives the body of the notification message that will be sent.
This parameter allows the use of texts with or without HTML formatting and can be provided in quotes, variables, or lang.
|
Using variable
$msg_not = "Notification message body";
'message' => $msg_not
Direct text in the macro
'message' => 'Notification message body'
|
destiny_type =>
|
Mandatory parameter that defines what data must be provided in the to parameter for sending the notification.
The values that must be provided are:
- 'user' - Defines that the to parameter must receive the login of the users who should receive the notification message.
- 'group' - Defines that the to parameter must receive the names of the groups, from the security module, that should receive the notification message. This option is only available in systems that use the security module by group.
- 'all' - Defines that all system users should receive the notification message. In this case, the to parameter must be passed as empty.
- 'profile' - Defines that the to parameter must receive the names of the profiles created in the notification system, in the Send Notification application, that should receive the message.
|
Example of how the parameter should be provided
'destiny_type' => 'user'
Accepted values are: user, group, all and profile |
to =>
|
Defines the system users who should receive the notification, within the universe defined in the destiny_type parameter.
- When specifying destiny_type =>'user' - The developer must provide a list of the logins of the users who should receive the notification. The provided values must be separated by semicolons (;).
- When specifying destiny_type => 'group' - The developer must provide the list of user groups, from the security module, that should receive the notification.
- When specifying destiny_type => 'all' - In this case, all system users should receive the notification, and the to parameter must receive an empty value.
- destiny_type => 'profile' - The developer must provide the names of the profiles created in the notification system, in the Send Notification application, that should receive the message.
In all cases, the provided values must be separated by semicolons (;)
|
Example when using destiny_type =>'user'
'to' => 'joao;pedro;carlos'
Example when using destiny_type =>'group'
'to' => 'employees;administrators'
Example when using destiny_type =>'all'
'to' => ''
Example when using destiny_type =>'profile'
'to' => 'sending_group_name1;sending_group_name2'
|
from =>
|
Mandatory parameter that defines the system user sending the notification.
This parameter accepts only one value at a time and can be defined by directly providing a user's name or through a variable.
|
'from' => 'admin' |
link =>
|
Optional parameter that receives a link to access an application in the system or an external URL.
The text can be provided in quotes, using variables.
|
Providing an external URL
'link' => 'https://scriptcase.com.br/'
Providing an application from the system
'link' => 'app_name'
|
dtexpire =>
|
Optional parameter that defines the date and time when the notification will expire and will no longer be displayed in the quick access icon of the menu. Upon reaching the date, the user will only be able to access the message through the inbox application.
The date and time format must be: YYYY-MM-DD HH:MM:SS
|
'dtexpire' => '2024-10-02 23:59:59' |
profile =>
|
Mandatory parameter that must receive the name of the profile that the developer specified when creating the notification module in the Scriptcase interface.
|
'profile' => 'samples_notification' |
Example
$title = 'New user'; $msg = 'User: ' . $struser . ' registered in the system';
sc_send_notification([ 'title' => $title, 'message' => $msg, 'destiny_type' => 'user', 'to' => 'admin', 'from' => 'admin', 'link' => '', 'dtexpire' => '2024-10-02 23:59:59', 'profile' => 'samples_profile_name', ]);
|
Macro Scope
|
Blank application
|
calendar application
|
chart application
|
Grid application
|
Search application
|
Form application
|
Control Form
|
Menu application
|
Responsive Menu
|
Tree menu
|
ReportPDF application
|
allMacros onExecute
|
ajaxFieldonBlur ajaxFieldonChange ajaxFieldonClick ajaxFieldonFocus allMacros onAfterDelete onAfterInsert onAfterUpdate onApplicationInit onBeforeDelete onBeforeInsert onBeforeUpdate onCalendarApplicationInit onCalendarScriptInit onInit onLoadAll onRefresh onValidate onValidateFailure onValidateSuccess
|
allMacros onApplicationInit onFooter onHeader onInit
|
ajaxFieldonClick allMacros onApplicationInit onFooter onGroupBy onHeader onInit onNavigate onRecord
|
allMacros onApplicationInit onFilterInit onFilterRefresh onFilterSave onFilterValidate
|
ajaxFieldonBlur ajaxFieldonChange ajaxFieldonClick ajaxFieldonFocus allMacros onAfterDelete onAfterDeleteAll onAfterInsert onAfterInsertAll onAfterUpdate onAfterUpdateAll onApplicationInit onBeforeDelete onBeforeDeleteAll onBeforeInsert onBeforeInsertAll onBeforeUpdate onBeforeUpdateAll onClick onInit onLoadAll onNavigate onRecord onRefresh onValidate onValidateFailure onValidateSuccess
|
ajaxFieldonBlur ajaxFieldonChange ajaxFieldonClick ajaxFieldonFocus allMacros onApplicationInit onClick onInit onLoadAll onRefresh onValidate onValidateFailure onValidateSuccess
|
allMacros onApplicationInit onExecute onLoad
|
onApplicationInit onExecute onLoad
|
allMacros onApplicationInit onExecute onLoad
|
allMacros onApplicationInit onFooter onHeader onInit onRecord
|
|