In order to separate the logic of building a message and the mechanism for sending it, the template mechanism is used. A template represents a set of rules used to construct the body of a message, its subject, addressees, copies, etc.
A template can include several messages. They are accessed using a simple text key.
When building a message, a data model, additional parameters that are passed by the sender and environment variables can be used.
When the system needs to send a message, it simply indicates on what template it needs to be built and passes the required parameters such as template name, message key, ID for the data model, and arbitrary parameters.
The sending subsystem selects the required message, loads the data model (if necessary), forms the message text directly using the bindings and sends it to the addressee.
You can send a message in the following ways: