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

     1  
     2  ---
     3  title: "Twilio"
     4  linkTitle: "twilio"
     5  date: 2021-10-20
     6  description: >
     7  
     8  ---
     9  
    10  Sending SMS notifications through the notification service provider [Twilio](https://www.twilio.com/messaging). To be able to send messages, registration with [Twilio](https://www.twilio.com/messaging) and a positive balance are required.
    11  
    12  ### Configuration:
    13  * Token
    14  * Sid
    15  * From
    16  
    17  ### Attributes:
    18  * Amount
    19  * Sid
    20  * Currency
    21  
    22  ### JavaScript Properties:
    23  
    24  ----------------
    25  
    26  ### New Message
    27  
    28  Creates a message object
    29  
    30  ```coffeescript
    31  msg = notifr.newMessage();
    32  msg.entity_id = 'twilio.name';
    33  msg.attributes = {
    34    'phone': '+79990000001',
    35    'body': 'some text'
    36  };
    37  
    38  ```
    39  | Value | Description |
    40  |-------|-------------|
    41  | newMessage() | Method |
    42  | msg | Type: Object (Message) |
    43  
    44  ----------------
    45  
    46  ### Code Example:
    47  
    48  ```coffeescript
    49  # twilio
    50  # ##################################
    51  
    52  sendMsg =(body)->
    53    msg = notifr.newMessage();
    54    msg.entity_id = 'twilio.name';
    55    msg.attributes = {
    56      'phone': '+79990000001',
    57      'body': 'some text'
    58    };
    59    notifr.send(msg);
    60  ```
    61