RafflePress Logo
  1. Home
  2. Knowledge Base
  3. Integrations
  4. Complete Action or Add User Programmatically

Complete Action or Add User Programmatically

NOTE: This document is intended for developers.

RafflePress has an Invent Your Own action which lets you create custom actions that RafflePress does not have out of the box. This guide will show you how to programmatically complete these actions.

In this example, we will create a custom action that users get entires in exchange for completing a survey form.

  1. Create the action in RafflePress

    Note: If you need to hide the action from the user you can get the class id of the action and add custom css to hide. Example: .rafflepress-action-9chrxc{display:none}
  2. Next, get the giveaway id which can be found in the URL while viewing the giveaway in the admin area.
  3. Next, get the action id which you can get in the URL while editing the action.
  4. Finally, review the code in this sample plugin below available in our GitHub repository.
    https://gist.github.com/seedprod/b8abe1d0076c4281e6e19a679baacaaeThis plugin requires the giveaway_id, action_id, and email parameters. It contains two code samples: one adds a user, and the other programmatically complete an entry.

    With this plugin active, we would call this action when the Survey is completed to programmatically complete the entry.

Was this article helpful?

Related Articles

Need Support?

Can't find the answer you're looking for?
Contact Support

Copyright © 2024 SeedProd LLC. RafflePress® is a registered trademark of SeedProd LLC

WPBeginner Verified Badge