github.com/e154/smart-home@v0.17.2-0.20240311175135-e530a6e5cd45/doc/content/en/docs/plugins/notify/_index.md (about)

     1  
     2  ---
     3  title: "Отправка сообщений"
     4  linkTitle: "notify"
     5  date: 2021-10-20
     6  description: >
     7  
     8  ---
     9  
    10  The system has a plugin called "notifr" that provides notification capabilities. It supports methods for sending notifications through various channels, including SMS, push notifications, email, Telegram, and HTML5 notifications.
    11  
    12  Here are the supported notification methods provided by the "notifr" plugin:
    13  
    14  1. SMS: Allows sending SMS notifications.
    15  2. Push: Enables sending push notifications to mobile devices.
    16  3. Email: Supports sending email notifications.
    17  4. Telegram: Provides the ability to send notifications through Telegram messenger.
    18  5. HTML5 notifications: Allows displaying notifications using HTML5 capabilities.
    19  
    20  With the "notifr" plugin, you can utilize these methods to send notifications to users through different channels based on their preferences or the nature of the notification.
    21  
    22  Please note that the specific implementation and usage details of each method may vary based on the configuration and setup of the "notifr" plugin in your system.
    23  
    24  ### javascript свойства
    25  ----------------
    26  
    27  ### New message
    28  
    29  Create message object
    30  
    31  ```coffeescript
    32    msg = notifr.newMessage();
    33  ```
    34  |  Property  | Description  |
    35  |-------------|---------|
    36  | newMessage() |    метод   |
    37  | msg |   type: Object [Message](#объект-message)  |
    38  
    39  
    40  ----------------
    41  
    42  ### Send message
    43  
    44  
    45  ```coffeescript
    46    notifr.send(msg);
    47  ```
    48  |  Property  | Description  |
    49  |-------------|---------|
    50  | send() |    метод   |
    51  | msg |   type: Object (Message)  |
    52  
    53  
    54  ### Object Message
    55  
    56  ```coffeescript
    57    message = {
    58    from: "",
    59    type: "",
    60    attributes: {
    61      "key": "vlue"
    62    }
    63  }
    64  ``` 
    65  
    66  |  Property  | Description  |
    67  |-------------|---------|
    68  | from |    type: string   |
    69  | type |    type: string   |
    70  | attributes |   type: map[string]string  |