WPIntell

Source evidence

automatically block emails from users

Simple Giveaways – Grow your business, email lists and traffic with contests · support · 2022-10-28T14:55:00+00:00

complaintsentiment
mediumseverity
0.92relevance
2replies
Evidence linked to opportunitycommercial context

Proof Health

Open evidence

Commercial opportunities need traceable source links before they are treated as build-worthy.

4 / 27 rows with source links

14.8% of this page's analysis has direct source links.

0 build-decision rows missing links

0 rows here require auditable proof before promotion.

23 rows with no attached evidence

0 rows have source counts but still need direct links.

Conversation

support
ewraniwego unresolved
Hello, I would like to organize several giveways on my site but I would like that if a user has already participated in a giveway, he can’t participate in the other giveways. Is it possible to automatically block a user’s email address after his email has already been used? Is this possible in PHP for example from the functions.php? Thanks a lot! Hi @ewraniwego , that’s a premium feature, where you can decide on how many giveaways can 1 email register to. A simplified code: add_action( 'sg_process_registration', 'ewraniwego_block_email_from_multiple_giveaways' ); function ewraniwego_block_email_from_multiple_giveaways( $front ) { global $wpdb; $email = isset( $front->posted_data['sg_form']['user_email'] ) ? $front->posted_data['sg_form']['user_email'] : false; if ( ! $email ) { $front->add_error( 'no-email', __( 'No Email Provided', 'your_textdomain' ) ); return false; } $count = $wpdb->get_var( $wpdb->prepare( 'SELECT COUNT(*) FROM ' . $wpdb->giveasap_entries . ' WHERE email = %s', $email ) ); if ( absint( $count ) ) { $front->add_error( 'max-met', __( 'You are already signed up to a giveaway', 'your_textdomain' ) ); return false; } return true; } This reply was modified 3 years, 7 months ago by Igor Benic . Hi @ibenic , Thank you for your answer. It works perfectly on my site. Thank you very much.

Comments

2 shown
Igor Benic 2022-10-28T20:19:00+00:00

Hi @ewraniwego , that’s a premium feature, where you can decide on how many giveaways can 1 email register to. A simplified code: add_action( 'sg_process_registration', 'ewraniwego_block_email_from_multiple_giveaways' ); function ewraniwego_block_email_from_multiple_giveaways( $front ) { global $wpdb; $email = isset( $front->posted_data['sg_form']['user_email'] ) ? $front->posted_data['sg_form']['user_email'] : false; if ( ! $email ) { $front->add_error( 'no-email', __( 'No Email Provided', 'your_textdomain' ) ); return false; } $count = $wpdb->get_var( $wpdb->prepare( 'SELECT COUNT(*) FROM ' . $wpdb->giveasap_entries . ' WHERE email = %s', $email ) ); if ( absint( $count ) ) { $front->add_error( 'max-met', __( 'You are already signed up to a giveaway', 'your_textdomain' ) ); return false; } return true; } This reply was modified 3 years, 7 months ago by Igor Benic .

ewraniwego 2022-10-31T13:08:00+00:00

Hi @ibenic , Thank you for your answer. It works perfectly on my site. Thank you very much.