Recipes are predefined newsletter templates generated from an entry. You can set up as many recipes as you want to.
1. Create a new setting called "newsletter_generator". Datatype is JSON
2. Set up the JSON structure:
{
":structure_id" : {
":recipe_alias" : {
"label":"Name of the recipe",
"description":"A short description",
"template":":template_id",
"models":{
":myModelName":":fieldAlias"
},
"dates": {
"dateField":"dateFormat"
},
"blocks":[
{
"block":":blockAlias",
"content" : [
{
"alias":":contentAlias",
"content": ":contentHtml"
}
]
},
]
}
}
Field definitions:
Field | Description |
models | Used for entry-fields to get entries. For example, if a structure has a field called location which is a entry from a different structure, you may create a model with the modelName "venue" and put "location" as the fieldAlias. |
dates | Format date-fields by adding dateFormat to each field. |
blocks | Blocks being set up in the newsletter. Define all the blocks you need, and put standard content into the blocks. |
contentHtml | Use mustache {{}} as a template language to get content from the entry you are creating. {{ entry.fieldAlias }} |
template | Refers to the id of the newsletter design template you want to use on the generated newsletters. |