Contact form does not send second email

On my website I got Contact Form 7 installed and configured.
However there is Mail (2) set up also to send email to user which fill the formon site.
When you fill form there is spinning wheel all the time: admin get the email but user who fill form and paste him email do not receive it.

  • Adam Czajczyk

    Hello mpress

    I hope you're well today!

    I just tried to send a message using the form in question. I selected the "Centraal Secretariaat" option, filled in a form using one of my gmail addresses and clicking on submit button, I got this message:

    Jouw bericht werd succesvol verzonden.

    That would suggest that the messages were sent, there was no spinning wheel or any "hang ups". However, it seems that I didn't receive message as well. Can you confirm if you received it or not? It's titled as a "Test message" and has my name in e-mail address, you'll easily recognize it :slight_smile:

    Also, have you tried to use SMTP plugin to deliver mails? I see you got one installed but it seems to be inactive currently.

    Let me know, please.

    Kind regards,
    Adam

  • mpress

    Hi Adam Czajczyk ,

    I have tried to use this SMTP plugin, no success.

    Further, I have copied cf7 to another subsite. Both email (1) and email (2) were sent and received using that email that was giving that spinning wheel..
    I just filled this same form with your gmail address (no spinning wheel).
    Please confirm if you have received this email (2) and be free to test it yourself.

    So it looks like issue is only within root site.
    Checked both sites - root and this subsite - subsite has more plugins activated than root site.

    Cheers.

  • Predrag Dubajic

    Hi mpress,

    You copied the form directly from the main site, it has all the same fields and settings, right?
    Do you have any plugins active on main site that you don't have on that subsite?
    If you do try enabling them on subsite to see if any of those could be causing the issue.

    You could also try installing plugin like https://wordpress.org/plugins/wp-mail-logging/ to see if that will provide more info about the missing emails.

    Can you also grant support access again since it has expired?

    Best regards,
    Predrag

  • mpress

    Predrag Dubajic , Adam Czajczyk

    I have activated this plugin https://wordpress.org/plugins/wp-mail-logging/ but do not know if I have used it correctly. Does it work like Flamingo?

    Just tried to have some more forms sent.
    It looks like 1st time for an email address goes smooth (both 1st and 2nd email are sent) but a 2nd try with same email does not goes thru (1st email is sent, but not the 2nd - no log by Flamingo), then you get that spinning wheel.

    Cheers.

  • Predrag Dubajic

    Hi mpress,

    If the email is not in the log that means it doesn't even get to the point of getting sent.
    This could be quite possibly a conflict with something on your site which prevents emails from working properly and I would suggest setting up a staging site where you could perform full conflict test and see if that returns any results.

    Have you tried contacting CF7 support about this as well as they might be already familiar with such cases and might be able to give you some additional info on how to debug it further?

    Best regards,
    Predrag

  • mpress

    Hi Predrag Dubajic ,

    If the email is not in the log that means it doesn't even get to the point of getting sent.

    Form filled 1st time, email shows up on Flaming list. Both emails (1) and (2) are sent and received.
    Form filled a 2nd time with same email gives a spinning wheel. Flamingo shows nothing about this 2nd attempt, although email (1) is sent and received, email (2) has never been seen or received.

    This could be quite possibly a conflict with something on your site which prevents emails from working properly and I would suggest setting up a staging site where you could perform full conflict test and see if that returns any results.

    I was just going to write about this :slight_smile: Does Shipper work now to duplicate/stage a multisite install? If not, I was thinking about cloning only root site and try it as a single install stage.

    Have you tried contacting CF7 support about this as well as they might be already familiar with such cases and might be able to give you some additional info on how to debug it further?

    Not yet. I thought it was something we could easily fix together.

    Cheers

  • mpress

    Hi Predrag Dubajic ,

    I have found an old stage from this site, where some new plugins were not installed yet.
    Tried cf7, I was able to send more than 3 forms using the same visitors email address.
    then I started to add the new plugins (the ones live install has).
    1st plugin I installed is "Subscriber by email", no issues. After this I installed a mu plugin given to me to adjust some settings from "Subscriber by email". I think this is the thread talking about this mu-plugin: https://premium.wpmudev.org/forums/topic/sbe-showing-an-extra-checkbox-field
    this is the mu plugin:

    <?php
    add_filter( 'wp_mail', function( $atts ) {
    	global $wpdb;
    
    	$myposts = $wpdb->get_results( "SELECT * FROM {$wpdb->posts} WHERE post_title LIKE '%". $atts['to'] ."%'" );
    
    	if ( ! empty( $myposts ) ) {
    	    $subscriber = incsub_sbe_get_subscriber( $myposts[0]->ID );
    
    	    if( ! isset( $subscriber ) ) {
    	        return $atts;
    	    }
    
    	    $meta_value = $subscriber->get_meta( 'naam', '' );
    
    	    $data = '';
    
    	    if( isset( $meta_value ) && $meta_value != '' ) {
    	        $data = $meta_value;
    	    }
    
    	    $atts['message'] = str_replace( '%SBE_NAAM%', $data, $atts['message'] );
    	}
    
    	return $atts;
    } );

    So, after adding this mu-plugin I was not able anymore to send a form for recurring email address.
    I hope you can help me further on this. If you can see my sites here, this stage site is the one that starts with beta.domainname.nl

    Cheers.

  • Adam Czajczyk

    Hi mpress

    Thanks for testing this and letting us know. This particular code is relate to adding custom field, as discussed in this ticket of yours:

    https://premium.wpmudev.org/forums/topic/subscribe-by-email-custom-fields-1

    What it does is it replaces the %SBE_NAAM% placeholder with a value of a custom field assigned to a post. I tried to test that code on my own setup by creating a CF7 form that sends e-mail to a designated address and a second one to an e-mail submitted in a form, enabling Subscribe by E-mail plugin and adding this custom code.

    However, it did work on my end and it didn't interrupt e-mail delivery. I understand that you can confirm that after removing this code everything works fine again, right?

    This code does interact with the core "wp_mail()" function which is used to send e-mail but in theory it shouldn't "block" it - if there's no post containing that custom field or the field is empty this custom code should be "transparent". I'm thinking then that this might not necessarily be a direct conflict of that code with CF7 but instead (or in addition) with some other setting or custom code on the site.

    Did you test the site with nothing else except only CF7, SbE and this custom plugin enabled?

    The custom field that this code is addressing: is it added as Subscribe by E-mail custom field (on "Subscriptions -> Settings -> Custom Fields" page) and if so - what type o the field is selected and is it set as required? Or is it a custom field that's added to post?

    Let me know, please, I'd like to test that too on my end.

    Best regards,
    Adam

    • mpress

      Hi Adam Czajczyk ,

      Did you test the site with nothing else except only CF7, SbE and this custom plugin enabled?

      Not yet :slight_smile: will try it later and let you know results of this.

      The custom field that this code is addressing: is it added as Subscribe by E-mail custom field (on "Subscriptions -> Settings -> Custom Fields" page) and if so - what type o the field is selected and is it set as required? Or is it a custom field that's added to post?

      As far as I can remember GDPR option was added using codes and name of subscriber added by the backend , both required fields. We have the form by one of the widgets at the right sidebar (homepage only), and also by a popup that appears at from bottom side.

      Both live site and beta have access granted if you need.
      Now Subscriber by email is deactivated by both sites.

      Cheers

      • mpress

        Hi Adam Czajczyk ,

        Did you test the site with nothing else except only CF7, SbE and this custom plugin enabled?

        I have tested it on the stage site with only CF7 and this mu-plugin + Twenty Fifteen theme (just to be sure that theme is not causing this). As soon as I delete mu-plugin, form sends email (1) and email (2).
        Then when I add mu-plugin back it starting spinning, then only email (1) is sent.

        Now I have also CF7, mu-plugin and wpmudev dashboard installed/active on the stage site, to be able to grant access.
        All other plugins are moved to folder /wp-content/plugins-hold
        Access is granted for both sites.

        Please advise. Thanks

        Cheers

  • Adam Czajczyk

    Hello mpress

    That would confirm then that this custom plugin is actually causing that after all. It's been provided by one of my colleagues regarding a different issue but aside from knowing what it is suppose to do (and that it does hook to native "wp-mail()" function) I'm not quite sure how this could possibly interact with CF7 or WP itself in other ways.

    I think I'll need to consult that with our devs (I'll also ask Ash who provided the code) for consultation so I passed all the information to them and am awaiting for feedback.

    Keep an eye on this ticket, please, and we'll update you here as soon as we got some more ideas about the case.

    Kind regards,
    Adam

  • Konstantinos Xenos

    Hey mpress ,

    You're correct, we recently fixed the extra fields on your SBE together :slight_smile: .

    Could you please send me some credentials for the Staging site ( since it can be replicated there also ) so I can take a look where the trouble is with CF7 and debug freely?

    You can send me the information needed privately through our contact form at https://premium.wpmudev.org/contact/#i-have-a-different-question by following this example:

    Subject: "Attn: Konstantinos Xenos"
    
    - Admin login ( if Multisite please provide Super Admin details ):
    Admin Username:
    Admin Password:
    Login URL:
    
    - FTP credentials
    Hostname:
    Username:
    Password:
    Port:
    Key-File ( and password ) if needed
    
    - Link back to this thread for reference
    - Any other relevant URLs -or- information regarding the issue that was not included in this thread

    Regards,
    Konstantinos

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.