Yes, it is possible to build a marketing email via API with a table and fields. Here are the steps involved:
1. **Create a new marketing email.** To do this, you will need to make a POST request to the `/marketing/v1/emails` endpoint. The request body must be a JSON-formatted object with the following properties: * `name`: The name of the marketing email. * `subject`: The subject line of the marketing email. * `content`: The content of the marketing email. This can be a plain text or HTML string. * `template`: The ID of a marketing email template that you want to use. If you do not specify a template, the marketing email will be sent as plain text.
2. **Add a table to the marketing email.** To do this, you will need to make a POST request to the `/marketing/v1/emails/tables` endpoint. The request body must be a JSON-formatted object with the following properties: * `name`: The name of the table. * `columns`: An array of objects that define the columns in the table. Each object must have the following properties: * `name`: The name of the column. * `type`: The type of the column. Valid values are `text`, `number`, `date`, and `time`. * `isRequired`: Whether or not the column is required.
3. **Add fields to the table.** To do this, you will need to make a POST request to the `/marketing/v1/emails/tables/fields` endpoint. The request body must be a JSON-formatted object with the following properties: * `name`: The name of the field. * `column`: The ID of the column that the field belongs to. * `value`: The value of the field.
4. **Send the marketing email.** To do this, you will need to make a POST request to the `/marketing/v1/emails/send` endpoint. The request body must be a JSON-formatted object with the following properties: * `email`: The email address of the recipient. * `table`: The ID of the table that contains the data for the marketing email.
Here is an example of a JSON request body that you can use to build a marketing email with a table and fields:
This request will create a marketing email with a table that contains two columns: Product Name and Price. The email will be sent to the specified email address and will include the data for the table.
Hope this will helps you out. Please mark it as Solution Accepted to help other Community member.