I figured out a work around. I made the email field of the registration form visible to the admin only, checked off the "allow field to be populated dynamically" field, and set it to use a parameter called "email." I then added the following code to functions.php to to use a random email address for each new user that is completely hidden from them:
add_filter("gform_field_value_email", "populate_email");
function populate_email($value)
{
return substr(str_shuffle("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"), 0, 8) . '@domain.com';
}
where "@domain.com" was the actual domain for the site I'm building. This gets the job done. If anyone has a better approach I'm open to it.
Posted 11 years ago on Thursday December 27, 2012 |
Permalink