Run Automation When Blog Post Publishes?

Whats the best way to run an automation when a blog post goes live? We schedule our posts so we are unsure of the best way to approach this issue. There is no "When Blog Post Goes Live" API event.

Parents
  • So you're talking when you publish it but the publish date is set in the future?  Depending on how fast you want to notify people, you could have a job that runs every hour and looks for posts with publish dates/times that were within the last hour or so.  Could get a little tricky if your job does not execute right on time.  

    But you could query the blogposts, sort by date, and as soon as you find a publish date that is out of bounds, just exit the loop.  You could even set an extended attribute on the post to flag if the automation executed on the post to avoid it being hit twice.

Reply
  • So you're talking when you publish it but the publish date is set in the future?  Depending on how fast you want to notify people, you could have a job that runs every hour and looks for posts with publish dates/times that were within the last hour or so.  Could get a little tricky if your job does not execute right on time.  

    But you could query the blogposts, sort by date, and as soon as you find a publish date that is out of bounds, just exit the loop.  You could even set an extended attribute on the post to flag if the automation executed on the post to avoid it being hit twice.

Children