RafflePress Documentation

Documentation, Reference Materials, and Tutorials for RafflePress

Categories

Join our Newsletter

Get free blogging tips, WordPress tutorials, and other resources.

We do not sell or share your information with anyone.

Let's Connect

  1. Home
  2. Docs
  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.
    https://gist.github.com/seedprod/b8abe1d0076c4281e6e19a679baacaae

    This plugin requires the giveaway_id, action_id, and email.

    There are two code samples. One adds a user and the other one programmatically completes an entry.

    So we would call this when the Survey is completed to programmatically complete the entry.


h

Still need help?
Contact Us

Related Articles

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

Terms & Conditions | Privacy Policy | Sitemap | RafflePress Coupon Code