In order to save a template for export to a file and attach to a record, a special type of action "Save template to export" has been developed.

The action settings display a list of fields of the File or Attachment type. In order to save a template to a file, select the required template from the list. Several templates can be specified for the Attachments field.

Pay attention to sorting, this action must be performed before changing the status. That is, when the status change and the message is sent, the file must already exist.