Closed jaypeng2015 closed 5 years ago
Unfortunately there isn't a great solution to this yet. For Craft 4, we want to get all entry publishing/expiring to happen via a job scheduler that runs every minute, at which point we could introduce new events that trigger right when an entry goes live, and right when an entry expires.
@brandonkelly I know this is a pretty old convo but is there any event that fires now when a post's status is changed based on the Expiry Date? Same question for the Post Date. Im not seeing much in way of documentation for when these events would be fired off if they do get fired off at all.
@brandonkelly Did this ever get implemented? I cannot find anything in the documentation that may even refer to this. Thanks!
@brandonkelly unfortunately I did end up getting an answer and the answer was that there's no mechanism that tells id something is expired or not. It calculates that when it calls the entry. So you'd have to set up a cron job or something to constantly check all posts and fire a webhook of the posts it found expired.
Had a feeling that would be the case. Thanks!
@brandonkelly sorry to dig this one up again, but is there any chance this is on the roadmap for Craft 5?
@reilnuud Sorry, we haven’t had a chance to circle back on this yet.
Craft Version: 3.2.6 Pro Plugin version: 2.1.0
Our use case is using webhooks to trigger another service to call element-api (https://github.com/craftcms/element-api) to get all the entries, and it works well for afterSave/afterDelete/afterRestore on entries.
However when adding
Post Date
andExpiry Date
to the entry, webhooks triggers immediately after save, but it doesn't trigger new events when the time comes toPost Date
andExpiry Date
, or maybe it does trigger but maybe some event that I do not know.Can someone please help?