Ok, so context - I want to send a weekly email to users with a list of 10 of the most recent jobs posted that week. I use Postmark - any suggestions?
basically just take DB users as a list and put that in API Call
Be sure you are using the right type of email sending format in postmark.
Postmark is normally used for âtransactionalâ emails, and it sounds like youâre talking about âmarketingâ emails.
Postmark wonât like that and could shut your account down.
Postmark has a specific api to send out marketing (bulk/mass) emails.
Itâs not a marketing email, itâs a setting that the user can turn on to have aggregated jobs sent directly to them at the frequency they specify.
If itâs 10 items every time make a standard HTML template youâll create (can use my plugin for this or any HTML builder)
Where the item block div container is youâll copy that code and remove it from the base template and replace it with {{code}}
Now take the individual block div code and use âdo search for jobs:items until 10:formatted as textâ
Now you will paste that block container code that you copied from earlier inside the formatted as text. Replace the name area with âthis jobs nameâ and similar for all dynamics.
Now you will use find and replace to replace {{code}} with the list that was generated from :formatted as text.
This should result in a full HTML email formatted from your initial template with now a list of those 10 searched items.
Alternatively you can go the long route of using an html template of all 10 items pre made using placeholders like {{item1name}} {{item2name}} etc and just do a large find and replace call or a looped find and replace call and cut out the :formatted as text. (This route will be less ideal but still work)
Yeah, I totally understand, but according to postmark i think what you described would be considered âmarketingâ.
âA marketing email would be anything a customer did not specifically trigger: for example, a weekly newsletter, a promotional offer, or an announcement about your siteâs recent updatesâ
From: Transactional vs. marketing email explained | Postmark
Anyway, just something for you to consider.
I agree with @jobs. Postmark would count this as a broadcast stream â which makes sense. If youâre getting a digest every week, Iâd hope that there would be a way to opt-out of it. If not, youâd get a lot of spam reports and your domain reputation will go down.
Batched requests is the way to go and the way @chris.williamson1996 described it is the method youâre going to want to use.
I would note that batched requests are limited to 500 at a time, so keep that in mind as you create a scalable way to send out these weekly digest emails.
I will give this a try this weekend, thank you!
the Postmark documentation is very nice, but if you have questions don t hesitate.