• Hi there!

    I want to prevent people from submitting their email in the “subscribe to newsletter” pop up window more than once. For example, if someone submits the same email again, I would like an error message to generate saying this email has already been used. Could you please let me know how I am able to do that?

    Thank you!
    Nancy

    The page I need help with: [log in to see the link]

Viewing 13 replies - 1 through 13 (of 13 total)
  • you should have in your database the list of all mails that have already been written to you, protect them etc. are you sure?

    anyway you can fairly easy, you need to write a custom validation for that field
    https://contactform7.com/2015/03/28/custom-validation/

    Thread Starter nanciizhang

    (@nanciizhang)

    Hi Erik,

    Thanks for writing back! I do not think I have the list of all emails in my database, could you please advise how I can add that in?

    Sorry I am not very techy with codes, please be patient with me as much as possible.

    Thank you!
    Nancy

    Unfortunately, what you are asking for is complex and would practically require a special plugin for this, there is Flamingo but alone would not be enough!

    let’s keep this as a feature request for @takayukister

    Thread Starter nanciizhang

    (@nanciizhang)

    ah okay, thanks Erik! Any other plugins you could recommend that would have this functionality?

    Thank you!
    Nancy

    I honestly don’t know I use very few plugins and when I need something like that I write something customized. And that’s why I like wpcf7, because you can do whatever you want with it!

    But this is just what i thought, maybe someone here has customised cf7+flamingo to do what you’re asking, I’m one but maybe someone else can help you!

    Thread Starter nanciizhang

    (@nanciizhang)

    Hi Erik,

    I find the code in this link might be helpful for this function: https://cfdbplugin.com/?page_id=904

    but one thing i’m not sure is where to add or how to use the code mentioned in this link to my wordpress since the “Add Shortcodes Actions And Filters” pluggin introduced in the link is no longer available in wordpress plugins.

    Thanks Erik,
    Nancy

    Cool! Seems with contact-form-7-to-database-extension you have another chance to do what you wanted! (actually, as I said, you could also do it with flamingo but can’t find any tutorial/guide about)

    The code is to be inserted in functions.php but I suggest you have it done by an expert or ask the support of that plugin how to do it! Please, be careful because you can disclose personal data, so I advise you to have it done by expert hands.

    Thread Starter nanciizhang

    (@nanciizhang)

    Thanks Erik!

    I added in the code and it generated an a fates error:

    This is what I am seeing as error message after I enter my email address to test:
    
    Warning: require_once(/home/customer/www/meleteamusa.com/public_html/wp-content/plugins/contact-form-7-to-database-extension/CFDBFormIterator.php): failed to open stream: No such file or directory in /home/customer/www/meleteamusa.com/public_html/wp-content/plugins/code-snippets/php/snippet-ops.php(469) : eval()'d code on line 8
    
    Fatal error: require_once(): Failed opening required '/home/customer/www/meleteamusa.com/public_html/wp-content/plugins/contact-form-7-to-database-extension/CFDBFormIterator.php' (include_path='.:/usr/local/php73/pear') in /home/customer/www/meleteamusa.com/public_html/wp-content/plugins/code-snippets/php/snippet-ops.php(469) : eval()'d code on line 8
    
    This is line 8 in my code:
    
    require_once(ABSPATH . ‘wp-content/plugins/contact-form-7-to-database-extension/CFDBFormIterator.php’);

    I asked the cfdb developer about this error message and they said this error came from contact form 7. Would you know where the issue is here? Appreciate your help Erik.

    Thanks,
    Nancy

    Thread Starter nanciizhang

    (@nanciizhang)

    I meant to say it generated a fatal error, auto correct is annoying lol

    since the error come from this folder …/plugins/contact-form-7-to-database-extension/… I’m inclined to think that the plugin that generates it. Anyhow if you want you can tell the author to write here and we’ll see what we can do to fix, mainly if it’s wpcf7’s fault!

    Thread Starter nanciizhang

    (@nanciizhang)

    Hi @takayukister ,

    I added the code to prevent duplicate email addresses being entered into the form, and this is what I am seeing as error message after I enter my email address to test:

    Warning: require_once(/home/customer/www/meleteamusa.com/public_html/wp-content/plugins/contact-form-7-to-database-extension/CFDBFormIterator.php): failed to open stream: No such file or directory in /home/customer/www/meleteamusa.com/public_html/wp-content/plugins/code-snippets/php/snippet-ops.php(469) : eval()’d code on line 8

    Fatal error: require_once(): Failed opening required ‘/home/customer/www/meleteamusa.com/public_html/wp-content/plugins/contact-form-7-to-database-extension/CFDBFormIterator.php’ (include_path=’.:/usr/local/php73/pear’) in /home/customer/www/meleteamusa.com/public_html/wp-content/plugins/code-snippets/php/snippet-ops.php(469) : eval()’d code on line 8

    This is line 8 in my code:

    require_once(ABSPATH . ‘wp-content/plugins/contact-form-7-to-database-extension/CFDBFormIterator.php’);`

    Wonder if you are able to jump in and see where the issue is?

    Thanks!
    Nancy

    I was referring to the author of “contact-form-7-to-database-extension” @msimpson, because checking the open issues on github this plugin has a lot of troubles and the cause isn’t wpcf7 (at least from the error log)
    https://github.com/mdsimpson/contact-form-7-to-database-extension/issues

    Thread Starter nanciizhang

    (@nanciizhang)

    Thanks Erik!

    @msimpson are you able to take a look?

    Thanks!

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Preventing customers from submitting their email address more than once’ is closed to new replies.