Simplify your stack and build anything. Or everything.
Build tomorrow’s web with a modern solution you truly own.
Code-based nature means you can build on top of it to power anything.
It’s time to take back your content infrastructure.

How extensible are payload hooks

default discord avatar
midka2 years ago
2

Hey everyone!


I'm currently comparing my options for building a website for an event. It has to have functionality to vote for a team. Voting would be '1 vote/phone number' so is that possible with (maybe collection) hooks? It would use an external API for sending a SMS and verify the code that would be stored in another collection.



Thanks!

  • discord user avatar
    alessiogr
    2 years ago

    Hi there,



    sounds like that should be easily possible! You could use a field

    validate

    to check if there have been multiple votes for that phone number, and if so, reject it there.



    In an afterChange or beforeChange hook, you could then trigger the sending of an SMS, so that it would trigger whenever a new Vote has been created

  • default discord avatar
    midka2 years ago

    Oh, thanks! Just wanted to confirm :)

Star on GitHub

Star

Chat on Discord

Discord

online

Can't find what you're looking for?

Get dedicated engineering support directly from the Payload team.