E-mail notifications
The following queries are used for management:
addmail - create or edit an e-mail notification. Extra options are:
- k - user session ID;
- id - the identifier of the notification by e-mail; if the identifier is absent a new notification is created, otherwise the existing notification is edited;
- name - the name of the notification by e-mail (transmitted in the message subject), the length is not more than 63 characters;
- server - SMTP server, the length is not more than 127 characters;
- port - the SMTP service port on the server;
- ssl_active - SSL when communicating with the mail server, true or false;
- starttls - true or false;
- login - the name of the account on the server, the length is not more than 63 characters;
- password - the password of the account on the server, the length is not more than 63 characters;
- from - the address of the sender, the length is not more than 63 characters;
- to - the address of the recipient, not more than 10 addresses with a maximum length of 63 characters each;
- message - message text template, the length is not more than 1023 characters;
- subject - custom subject field of e-mail message, up to 255 characters, if left blank, the field is automatically generated.
If a new element is successfully created, the response contains the element identifier, and looks like:
<error type="no error" id="601001" /> |
When creating a new notification (id is not specified), all the listed parameters are mandatory. When modifying, only modifiable parameters can be specified. Empty parameters are not allowed.
delmail - delete the notification by e-mail. Required parameters are:
- k - user session ID;
- id - the identifier of the notification by e-mail.
testmessage - send a test message, without creating a new element. Message text can use macros, a warning string is also added to the text. Required parameters are:
- k - user session ID;
- type - type of test notification (mail);
- server - SMTP server, the length is not more than 127 characters;
- port - the SMTP service port on the server;
- ssl_active - SSL when communicating with the mail server, true or false;
- starttls - true or false;
- login - the name of the account on the server, the length is not more than 63 characters;
- password - the password of the account on the server, the length is not more than 63 characters;
- from - the address of the sender, the length is not more than 63 characters;
- to - the address of the recipient, not more than 10 addresses with a maximum length of 63 characters each;
- message - message text template, the length is not more than 1023 characters;
- subject - custom subject field of e-mail message, up to 255 characters, if left blank, the field is automatically generated.
sendmail - send a e-mail message, without creating a new element. Macros are not used, the message is sent as is. Required parameters are:
- k - user session ID;
- name - the name of the notification (as shown in the log messages), the length is not more than 63 characters;
- server - SMTP server, the length is not more than 127 characters;
- port - the SMTP service port on the server;
- ssl_active - SSL when communicating with the mail server, true or false;
- starttls - true or false;
- login - the name of the account on the server, the length is not more than 63 characters;
- password - the password of the account on the server, the length is not more than 63 characters;
- from - the address of the sender, the length is not more than 63 characters;
- to - the address of the recipient, not more than 10 addresses with a maximum length of 63 characters each;
- message - message text template, the length is not more than 1023 characters;
- subject - custom subject field of e-mail message, up to 255 characters, if left blank, the field is automatically generated.
getelement - read the element. Required parameters are:
- k - user session ID;
- id - element ID;
The response contains information about the element:
|