function theme_signup_custom_data_email in Signup 7
Same name and namespace in other branches
- 5.2 signup.module \theme_signup_custom_data_email()
- 5 signup.module \theme_signup_custom_data_email()
- 6.2 theme/email.inc \theme_signup_custom_data_email()
- 6 theme/email.inc \theme_signup_custom_data_email()
Renders custom signup data into unfiltered output for use in email.
WARNING: This theme function is recursive (it calls itself for nested data), so if you override it, be sure not to change the part where it does "call_user_func(__FUNCTION__)".
Parameters
array $data: An array of custom user signup data.
Return value
string Plain text output with newlines.
See also
2 theme calls to theme_signup_custom_data_email()
- hook_signup_cancel in ./
signup.api.php - Hook invoked when a signup is being canceled.
- theme_signup_email_token_custom_data in theme/
email.inc - Return the value for the %user_signup_info email token for custom signup data.
File
- theme/
email.inc, line 38 - Theme functions for generating signup email messages.
Code
function theme_signup_custom_data_email($variables) {
$data = $variables['data'];
$output = '';
// Loop through each first level element.
foreach ($data as $key => $value) {
if (is_array($value)) {
// Element is nested, render it recursively.
// Instead of the overhead of theme(), just call ourself directly.
$output .= "\n\r" . call_user_func(__FUNCTION__, $value) . "\n\r";
}
else {
$output .= theme('signup_custom_data_field_text', array(
'key' => $key,
'value' => $value,
)) . "\n\r";
}
}
return $output;
}