• Resolved holylibor

    (@holylibor)


    Hi,

    Firstly I´d like to congratulate your team for the great improvement of this plugin since I have lastly used it.
    I have an issue with sending of some confirmation emails.
    The user can choose whether to register an individual or a group. Depending on the choice, he will be shown a form in a Field group, one of the fields in this group is email. If he chooses individual registration in Field Group 2 with the tag email-2. the confirmation emails go out correctly. In case he chooses group registration, It shows the form in repeatable Field Group 1, where the field email has the tag email-1. So he registers 3 people with 3 emails. The records in the database are OK, the notification email to the admin goes out OK, but none of the participants receive a confirmation email. In the email settings, the recipient is email-1. Please can you advise me on the correct settings? Thanks.

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

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Support Patrick – WPMU DEV Support

    (@wpmudevsupport12)

    Hi @holylibor

    I hope you are doing well.

    I am happy to hear you enjoy the plugin.

    Could you please share your form using pastebin.com or Google drive https://wpmudev.com/docs/wpmu-dev-plugins/forminator/#import-export then we can take a closer look.

    Best Regards
    Patrick Freitas

    Thread Starter holylibor

    (@holylibor)

    Hi Patrick,

    Thank you very much for your replay. Sure, please feel free to download the form export from my Google drive: link

    Thank you in advance for your support.

    Best,

    Libor

    Plugin Support Williams – WPMU DEV Support

    (@wpmudevsupport3)

    Hi @holylibor,

    Hope this message finds you well.

    Thanks for the form, currently, Email Notification for emails inside the Field group do require a snippet, our Second Line Support provide this:

    
    <?php
    
    add_filter( 'forminator_replace_form_data', 'wpmudev_replace_form_data_recipient', 10, 3 );
    function wpmudev_replace_form_data_recipient( $content, $data, $original_content ) {
        if ( $data['form_id'] != 6 ) {
            return $content;
        }
    
        if ( strpos( $content, '{email-repeater}' ) !== false ) {
            $emails = array();
            foreach ( $data as $key => $value ) {
                if ( strpos( $key , 'email-1' ) !== false ) {
                    $emails[] = $data[$key];
                }
            }
    
            if ( ! empty( $emails ) ) {
                $recipients = implode( ',', $emails );
                $content = str_replace('{email-repeater}', $recipients , $content );
            }
        }
    
        return $content;
    }

    It requires some customization:

    – Replace number 6 with your form ID on this line:

    if ( $data['form_id'] != 6 ) {

    – Replace the email tag {email-1} with the one in your Field group on this line:

    if ( strpos( $key , 'email-1' ) !== false ) {

    – In the Email Notification recipient replace the email tag {email-?} with this macro: {email-repeater}

    You might need to install it as a mu-plugin following the instructions on this link https://wpmudev.com/docs/using-wordpress/installing-wordpress-plugins/#installing-mu-plugins.

    Let us know the results.

    Best regards,
    Laura

    Thread Starter holylibor

    (@holylibor)

    Dear Laura,

    Thank you very much for your help.

    It works perfectly now!

    May I bother you with an other question concerning Field group data structure or shall I open an other ticket?

    Hi @holylibor

    Please open a fresh ticket so we can follow up there separately in case it will be more complex and see can help in that matter.

    Kind Regards,
    Kris

    Thread Starter holylibor

    (@holylibor)

    OK, I will do so,

    Thank you once again for your help. You can close this ticket now!

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Confirmation email not send’ is closed to new replies.