Like what we’re doing? Star us on GitHub!

Schedule feature

gabrielsantos
3 weeks ago
3

Hello there.



We're proposing PayloadCMS to a customer, and I'm in charge of make some PoCs based on their scenarios I'm stuck in one of these that is to make schedule system to scheduling posts changing its status publish and unpublished given a date.



Is there a solution for this case?


Is Payload provides any features like a CLI or hooks to do this?

  • zubricks
    Payload Team
    2 weeks ago

    Hey @gabrielsantos while we've built similar functionality in the past, we don't have anything off-the-shelf (yet) for Payload. It has been discussed here -

    https://github.com/payloadcms/payload/discussions/567

    and will likely make its way to our roadmap!

  • Jarrod
    Payload Team
    2 weeks ago

    @gabrielsantos you could possibly get away with using a date field, and a beforeRead hook that checks the date on the publishAt date field, if less than now

    and

    not published, publish the doc - after the update return the updated doc in your hook. If the post is already published you could skip that step and return the doc arg given to you in the beforeRead hook.



    This might help get you to a working solution 👍

  • zubricks
    Payload Team
    2 weeks ago

    Good call Jarrod!

Open the post
Continue the discussion in Discord
Can't find what you're looking for?
Get help straight from the Payload team with an Enterprise License.Learn More