Hi guys,
This would usually be pretty simple if I were coding this but I’m having trouble wrapping my head around how to dynamically create a beehiiv post.
This is what the payload looks like in the “run code” block I have:
payload = {
"title": "Newsletter Title",
"subtitle": "Newsletter Subtitle",
"blocks": [
{
"type": "heading",
"level": "2",
"text": "This is my block!!!",
"anchorHeader": False,
"anchorIncludeInToc": False,
},
{
"type": "image",
"imageUrl": "https://cdn.britannica.com/89/164789-050-D6B5E2C7/Barack-Obama-2012.jpg",
"alt_text": "A picture of Barry Obama",
"caption": "One Cool President",
"captionAlignment": "center",
"imageAlignment": "right",
"title": "Barry O",
"url": "https://www.whitehouse.gov/",
"width": 75
},
{
"type": "list",
"items": ["g", "h", "i"],
"listType": "unordered",
"startNumber": 4
},
{
"type": "paragraph",
"formattedText": [
{
"text": "Read the full story ",
"styling": ["italic"]
},
{
"text": "here",
"href": "/google.com",
"target": "_blank"
"styling": ["italic"]
}
]
},
],
# ... 4 more
}
In my flow, I will eventually have 5 sets of the above blocks.
How would you advise to build a flow for such an output?
Thanks