This article provides an overview of how the different messaging concepts fit together to provide a generic and flexible messaging solution. For each section of this article, a more in-depth article exists that provides additional details on that specific subject. This article is meant to tie those separate concepts together into a whole.
Each customer can have a set of email addresses associated with them, each identified by their own unique (within the customer) key. These keys can then be referred to later on in the process. In order to be able to send a customer an email, at least one email address should be specified for the customer. For example: each customer has an email address with key: InvoiceEmail and their own respective email address and name.
In order to send out emails, an SMTP server is required. This server and it’s properties can be defined under SMTP Settings. In this section we can also define one or more email addresses. These addresses can be used as source addresses to send email from. We will refer to them by their key in one of the next steps. For example: we specify an address with key: InvoiceSending and email address firstname.lastname@example.org.
A message template is used to define the content of each email generically. It is a template that defines the formatting and content of the email. In it we can use properties of the customer in question to make the emails more personalized.
A message definition defines a certain ‘type of message’. In the sense that it defines from which address (specified by key) to which addresses (specified by key) what content (specified by template) is sent. The definition also specifies the subject for the email and which invoice transformation result to attach. Note that nowhere do we specify actual invoices or customers. This happens in the Message Runs. In our running example the message definition could specify from: InvoiceSending, to InvoiceEmail, with subject: Your Company Invoice.
A message run is a specific instance of a message definition. It is created by running a message definition against a set of invoices transformation results. For each invoice transformation result (generally, a PDF) a message result is created within the message run. This message result represents an email. It is sent to the email address of the customer the invoice transformation result is for (specified by key), with the invoice transformation result in the attachment.