Set up rules for sending email when adding or editing a record.

By default, in Rukovoditel, when adding/editing a record, notifications are received by the assigned users. The text of the email is generated automatically and contains all fields of the record. If this behavior is not useful for your business processes, you can disable the default notification and configure your own rules for sending mail.

You can set up mail rules for each entity. There are rules for adding/editing a record and adding a comment.

When you create a rule you yourself set the subject and body of the email and you can use field values by inserting field ID in text. The rules

provide for the ability to send a message at a certain value of the field. You can send messages to assigned users or to specified users in rules.

Templates to Export

If templates for exporting are configured for an entity, then they can be automatically attached to the message. The list of available templates will automatically appear on the "Message Text" tab.

Send msg by date

The "Send by Date" rule makes it possible to send a message when a specified date occurs in the record. For example, it can be the End date of the task, or the payment date.

In the rule settings, specify a field of the "Date" type that will be used in the rule, also specify the number of days when you want to send a notification. For example, you can send a notification  before the due date.

HTML Blocks

You can create simple html templates that can be used in any email rules messages. Click on HTML Blocks button to add template.

To insert HTML template in email message use [block_ID]

send_by_id

Using the email_rules::send_by_id($entity_id, $item_id, $rule_id) function, you can force a message to be sent by a given ID. You can use this function in automation or PHP code.

email_rules::send_by_id(21, 12, 3);

$entity_id - entity id
$item_id - record id
$rule_id - rule id