Logic description
This article provides a detailed explanation of the logical process involved in utilizing the API method to create email messages.
Please be advisedPrior to initiating the creation of email templates using the API, it is essential to follow the instructions outlined on the Preparing to create emails page to ensure all necessary steps have been completed.
Within the API reference, you will find the Generate an email method, which facilitates the creation of email messages via the API. Although it may initially appear complex, we are here to guide you through the process by explaining each parameter involved in the request and providing practical examples for better understanding.
Now, let's delve into the specifics of the request's body for a more detailed examination.
{
dataSources: DataSourceDto[],
transformers: TransformerDto[],
composers: ComposerDto[],
templateId: Long,
emailId: Long,
emailName: String,
title: String,
preheader: String
}Here is a description of the parameters involved:
| Parameter | Required | Description |
|---|---|---|
dataSources | Mandatory | The dataSources refer to the content that will be utilized for generating the email message. Essentially, this is where you can specify the information appearing in your final email message.
|
transformers | Optional | This parameter represents the list of transformers that can be applied to the initial data in order to generate an email message.
|
composers | Optional | The list of composers is employed to map the data from the data source to the appropriate generation areas within the email message.
|
templateId | Mandatory | This parameter represents a template's ID containing the generation area for email message generation. It is important to note that this template must be one that you have created and saved within your own project rather than a basic or prepared template. To access and view all your templates, please navigate to the Templates menu within your Stripo account. |
emailId | Optional | If you wish to override an existing email message, please provide its ID in this parameter. Leaving this empty will result in the creation of a new email message. |
emailName | Optional | This parameter represents the desired name for the generated email message. If this is left empty, the template's name will be used as the name for the generated email message. |
title | Optional | This parameter determines the value that will be inserted into the <title> tag of the generated email message, which represents its subject line. |
preheader | Optional | This parameter specifies the value that will be inserted into the hidden preheader <span> tag of the generated email message. The preheader represents the invisible text within the email message that is visible to recipients before they open it, appearing right after the Subject line. |
Excellent job! Now, let's examine an example of the request provided in the following article.
