Compatibility with WP Mail SMTP ?

Support MB Frontend Submission Compatibility with WP Mail SMTP ?Resolved

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #36297
    YasmineYasmine
    Participant

    Hello, I added WP Mail SMTP to generate an email after a form is submitted. The hook works.

    However, the redirect after submitting the form no longer works. I checked the shortcode and its the same as when it was working. Since adding `WP Mail SMTP' it just redirects to a blank page. Is there a better plugin thats compatible?

    #36312
    Long NguyenLong Nguyen
    Moderator

    Hi,

    The plugin WP Mail SMTP just helps you to configure WordPress to use a proper SMTP provider when sending emails with the function wp_mail() as in the documentation. So I think it's not the issue in this case. If you deactivate this plugin, is the issue resolved?

    #36324
    YasmineYasmine
    Participant

    Ok you are right. When the plugin was deactivated, the issue remained.

    But I did find the issue, when I deactivated this snippet, the redirect worked again:

    add_action( 'rwmb_frontend_after_process', function( $config, $post_id ) {
        if ( 'research-summary' === $config['id'] ) {
            wp_mail( '$myemail', 'Summary pending', 'A new research summary has been just submitted:
    		Dashboard:$mydashboardlink 
    		Google drive link: $linktoagoogledrive' ); //have replaced the links purposely with $ 
            die;
        }
    }, 10, 2 );

    Is it because this is overriding the action to redirect? And how would I fix this?

    #36331
    Long NguyenLong Nguyen
    Moderator

    Hi,

    I do not see the redirect function in your code. If you only want to send an email after submitting the form, please remove this code

    die;

    Read more on the documentation https://docs.metabox.io/extensions/mb-frontend-submission/#form-hooks

    #36336
    YasmineYasmine
    Participant

    The redirect is in my shortcode, not in this code. But I will remove die;. Thank you.

    #36407
    YasmineYasmine
    Participant

    This worked, thank you!

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.