DoSomething Signup - DoSomethingArchive/legacy-website GitHub Wiki
This module provides functionality for users to signup for a node type which implements it (current types: campaign
, campaign_group
).
Technically, a signup is simply a record in the dosomething_signup
table, which stores the user uid, the node nid, and the timestamp of the signup.
View Signups
Each node type which implements signups has a node_signups
view, accessed from node/[nid]/signups
path, which displays the node signups.
Users with the custom view any signup
permission are able to access this view.
Unsignup
Members (authenticated users) are currently unable to remove their signup from a node.
Staff users who signed up for a campaign are able to remove their signup record at node/[nid]/unsignup
. This is available for testing purposes.
Third Party Opt-In
Users with administer third party communication
are able to set custom third-party opt-in variables for specific nodes at admin/config/services/optins
.
These variables are stored in the dosomething_helpers_variable
table per relevant node.
Note: Any node which needs a Mailchimp subscription must include a Mailchimp Interest Group Name mailchimp_group_name
, an alphanumeric identifier, and a Mailchimp Grouping ID mailchimp_grouping_id
, a numeric ID which the Group belongs to.
Standard Campaigns
A standard Campaign is a Campaign node with Campaign type 'campaign'
.
-
Currently only Staff Pick campaigns are able to be assigned custom Mailchimp and/or Mobilecommons opt-in's.
-
If a user signs up for a non-staff-pick campaign, they are opted into the general campaign Mailchimp / Mobilecommons opt-in's.
Campaign Group
Each campaign_group
node may be assigned specific Mailchimp and Mobilecommons opt-in's.
SMS Games
An SMS Game is a Campaign node with Campaign type 'sms_game'
.
The SMS Game node template renders the dosomething_signup_sms_game_form
form, where a User must opt-in via their mobile number, and requires three additional mobile numbers to be submitted to opt-in friends. The dosomething_signup_sms_game_form_submit
handler calls dosomething_signup_sms_game_signup_request
which determines how to opt-in the inputted mobile numbers.
The opt-in paths for a SMS Game are set based on whether or not the SMS game is a single-player or multi-player game.
Single-Player
Single Player SMS Games require a mobilecommons_opt_in_path and a mobilecommons_friends_opt_in_path variable to be set.
If the single player paths are configured for the SMS Game form, the dosomething_signup_sms_game_signup_request
function sends the relevant opt-ins to Mobilecommons, to opt the numbers into the Single Player flow.
Multi-Player
Multi Player SMS Games require mp_story_id and mp_story_type variables set, which are configured by the SMS team.
The multi-player variables are set, the dosomething_signup_sms_game_signup_request
function sends the relevant opt-ins to the multi-player SMS Game.
Signup Data Form
Some campaigns collect additional data during the signup process. Examples:
-
Teens For Jeans
- Upon signup, user must select/confirm what school they belong to, or indicate that they are not affiliated with a school.
-
Comeback Clothes
- Users can optionally enter/confirm their address to be sent a promotional banner.
-
Thumb Wars
- Upon signup, user is prompted why they want thumb socks, and must enter/confirm their mailing address to be sent the thumb socks.
-
Give A Spit
- Upon signup, user is prompted to enter/confirm birthdate.
A "Signup Data Form" refers to the form that collects this additional signup data. The form configuration is stored in a custom table, dosomething_signup_data_form
, with fields:
-
nid
- The node nid which thesignup_data_form
record corresponds to. -
status
- If this is 1, the form is considered active and rendered on the campaign template. -
required
- If this is 1, the user must complete the form to access the campaign action page. If they navigate away from the campaign without submitting the form, they will be presented with the signup form again until they submit. -
required_allow_skip
- If this is 1, the user is presented with the option to skip on a required form. We track that they submitted, and don't prompt again. -
link_text
- The text to display on the link that opens a signup data form in a modal -
form_header
- Header text displayed on the signup data form. -
form_copy
- Copy text displayed on the signup data form. -
confirm_msg
- Text displayed in the message that appears after submission. -
collect_why_signedup
- Whether or not to prompt user for why they signed up. -
why_signedup_label
- The label to display on the textarea for user to enter reason why they signed up. -
collect_user_address
- Whether or not to prompt user for mailing address. -
collect_user_school
- Currently not implemented. -
collect_user_mobile
- Currently not implemented. -
collect_user_birthdate
- Currently not implemented.
Upon submititng a Signup Data Form, the relevant user information is stored to the user object (address, school, birthdate) and the timestamp of submission is stored in the dosomething_signup.signup_data_form_timestamp
column.
If the form is set to collect_why_signedup
, the user's input for the why_signedup
field is stored in the dosomething_signup.why_signedup
column.
The dosomething_signup.signup_data_form.inc
file code contains:
-
_dosomething_signup_node_signup_data_form
To be called from within a node edit form. Adds form elements which correspond to the values in the node nid'sdosomething_signup_data_form
record. -
dosomething_signup_user_signup_data_form
The form the user is presented with to enter additional signup data, dynamically rendered based on the values in the nodedosomething_signup_data_form
record.