Hi Eric,
You are doing multiple searches in your database when you are sending each email. It is 100% recommended that you convert this workflow to a recursive one.
On an equally important side note, you should be storing the Newsletters (list of Newsletters) as a state within your app, and then sending that single list to a recursive workflow, with the JSON-safe formatting. You are currently doing multiple searches for the same list of Newsletters. Not only is this slow, and almost certain to break when you reach a long list, you also run the risk of sending different fields of different Newsletters if your searches are inconsistent.
A recursive workflow in this case:
Starts with a termination condition (terminate this workflow if List of Newsletters = 0)
Sends an email to the first item on the list of Newsletters
Makes any necessary changes to the database (minimize the # of changes here for performance)
Schedules the same API workflow (calls itself), but without the first item. It is the bubble equivalent way of creating a loop.
Also, are “Recipient”, “Newsletter”, and “Events” are separate objects here-- and are they unrelated?
If this solution doesn’t fix your problem, attach a screenshot of your API call to Postmark. Include the body JSON.
I found this super useful for setting up my postmark email integration.
I can’t see anything obviously “wrong” with what you’re doing, but agree with others that recursive should help…
All my emails are working in testing but haven’t pushed to live yet, so fingers crossed. I need to check the format as JSON safe in my emails though. Hadn’t thought of that. Always something else to learn
Hello @martin9, yes that is great, and is actually what I used to setup the emails. My newsletter is sending, but found out this week they were not sending to everyone. I now have recursive setup for my newsletter and event notification emails. Newsletter goes out on Monday, so we will see if it actually goes to everyone this time.
My event emails is the main issue of this thread. I’m hoping recursive helps, but don’t feel that is it’s only issue. It works in test mode but not always in live mode. I’m getting JSON errors, and I’ve tried many different people’s suggestions. It just does not seem to be consistently working.
@johnny@ed727@dannyliu , and anyone else interested. I believe I’ve got it working now, and figured out the issue.
I implemented the Recursive, and while I certainly think this helped and will allow it to expand with more users I was still having JSON issues.
I kept trying different solutions, but they seemed to sometimes work, and other times not work. This is what I did which (fingers crossed) seems to be working now, and sending to the full list. Any of the inputs which have custom text which might have parentheses in it I added “formatted as JASON-safe”.
I remember being told that this actually adds parentheses back into the code, so I thought I try removing parentheses from the pluggin itself which is something I have not tried yet. So in the API Connector, I removed the parentheses for any of the fields I added the “formatted as JASON-safe”.