I am trying to implement a multistep registration form where if the user drops off the first step I then email them a link several weeks later for them to continue to step-2
http://example.com/user/register/step-2
After step two is complete the receive an email asking them to verify the account.
How do I load the users previous data if I send them directly to step2 at a later date. My ctools multistep currently looks like this after following this guide
function MYMODULE_registration_ctools_wizard($step = 'step-1') {
// Include required ctools files.
ctools_include('wizard');
ctools_include('object-cache');
$form_info = array(
// Specify unique form id for this form.
'id' => 'multistep_registration',
//Specify the path for this form. It is important to include space for the $step argument to be passed.
'path' => "user/register/%step",
// Show breadcrumb trail.
'show trail' => TRUE,
'show back' => FALSE,
'show return' => FALSE,
// Callback to use when the 'next' button is clicked.
'next callback' => 'MYMODULE_registration_subtask_next',
// Callback to use when entire form is completed.
'finish callback' => 'MYMODULE_registration_subtask_finish',
// Callback to use when user clicks final submit button.
'return callback' => 'MYMODULE_registration_subtask_finish',
// Callback to use when user cancels wizard.
'cancel callback' => 'MYMODULE_registration_subtask_cancel',
// Specify the order that the child forms will appear in, as well as their page titles.
'order' => array(
'step-1' => t('Step One'),
'step-2' => t('Step Two'),
'step-3' => t('Step Three'),
),
// Define the child forms. Be sure to use the same keys here that were user in the 'order' section of this array.
'forms' => array(
'step-1' => array(
'form id' => 'user_register_form'
),
'step-2' => array(
'form id' => 'MYMODULE_registration_group_info_form',
// Be sure to load the required include file if the form callback is not defined in the .module file.
//'include' => drupal_get_path('module', 'MYMODULE_registration') . '/MYMODULE_registration_groups_form.inc',
),
'step-3' => array(
'form id' => 'MYMODULE_registration_invite_form',
),
),
);
// Make cached data available within each step's $form_state array.
$form_state['signup_object'] = MYMODULE_registration_get_page_cache('signup');
$output = ctools_wizard_multistep_form($form_info, $step, $form_state);
return $output;
}
function MYMODULE_registration_get_page_cache($name) {
ctools_include('object-cache');
$cache = ctools_object_cache_get('MYMODULE_registration', $name);
// If the cached object doesn't exist yet, create an empty object.
if (!$cache) {
$cache = new stdClass();
$cache->locked = ctools_object_cache_test('MYMODULE_registration', $name);
}
return $cache;
}