Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all articles
Browse latest Browse all 8245

mike62 on "Capturing an email address from the front-end registration form"

$
0
0

I have a site using WooCommerce. I've added a checkbox to the registration form here, for subscribing to a newsletter:
https://www.hilarydruxman.com/my-account/

Is it possible, when the form is submitted to check to see if that newsletter checkbox is selected, and if it is, send the email address to a 3rd-party service? I'm using Sendy.

Thanks!

Here's the code I'm using to add the checkbox (in functions.php):

add_filter( 'register_form', 'adding_custom_registration_fields' );
function adding_custom_registration_fields( ) {
	echo '<div class="form-row form-row-wide"><label for="reg_subscribe"><input type="checkbox" name="reg_subscribe" id="reg_subscribe" value="'.esc_attr($_POST['is_subscribed']).'" />Subscribe to the newsletter</label></div>';
}

Viewing all articles
Browse latest Browse all 8245

Trending Articles