• Resolved hweill

    (@hweill)


    Hi there,

    On my form I have a conditional question whether they are attending all sessions, if they select yes, I have created the email with all the titles and links to these sessions. However, if the user has selected no, they they need to choose which sessions they will be joining.

    Instead of manually sending an email with the titles and sessions to these users, I would like it to go automatically but I am unable to work out how.

    I have added the links into the values section and the titles into the labels.

    I would appreciate your assistance. Thanks

    • This topic was modified 8 months, 1 week ago by hweill.

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

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Support Laura – WPMU DEV Support

    (@wpmudevsupport3)

    Hi @hweill,

    Hope this message finds you well.

    Currently, this requires an snippet:

    <?php
    add_action( 'forminator_custom_form_mail_before_send_mail', 'wpmudev_select_radio_labels_form', 10, 4 );
    function wpmudev_select_radio_labels_form( $cls, $custom_form, $data, $entry ) {
        if ( 6 != $custom_form->id ) { // Please change the form ID.
            return;
        }
        add_filter( 'forminator_replace_form_data', 'wpmudev_show_radio_select_labels', 10, 3 );
    }
    
    function wpmudev_show_radio_select_labels( $content, $data, $original_content ) {
        if ( strpos( $original_content, 'radio' ) !== false
                || strpos( $original_content, 'select' ) !== false
                || strpos( $original_content, 'checkbox' ) !== false
                ) {
                $field_id       = str_replace( array('{', '}'), '', $original_content );
                $replacement    = is_array( $data[$field_id] ) ? implode( ', ', $data[$field_id] ) : $data[$field_id];
                $content        = str_replace( $content, $content . '<br>' . $replacement, $content );
        }
    
        return $content;
    }

    Please replace number 6 with your Form ID on this line:

    if ( 6 != $custom_form->id ) { // Please change the form ID.

    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.

    Also, use this tag in the Email Notification Message to attach only the filled/selected values:

    {all_non_empty_fields}

    Let us know the results.

    Best regards,
    Laura

    Thread Starter hweill

    (@hweill)

    Thank you Laura, that was really helpful!

    2 more points on this:

    • can you make it a list going vertically with the label then the value and then a new line with the next label and next value etc…
    • Is there a way of getting it into the email without all the other fields that have been completed? Just the sessions field?

    Thank you!

    Plugin Support Nithin – WPMU DEV Support

    (@wpmudevsupport11)

    Hi @hweill,

    Could you also please share the form export so that we could have a better idea on how it currently behaves on your form side to see what further could be suggested?

    Please check the following doc on how to export a form:

    https://wpmudev.com/docs/wpmu-dev-plugins/forminator/#import-export

    If you are concerned about any sensitive information in the form, then you can duplicate your form, remove any sensitive information, and then export it.

    You can share the export file via Google Drive, Dropbox or any cloud service in the next reply.

    Looking forward to your response.

    Best Regards,

    Nithin

    Thread Starter hweill

    (@hweill)

    Hi Nithin (@wpmudevsupport11),

    Thank you for your response.

    Please see my exported form using the link below.

    I look forward to hearing further from you!

    https://drive.google.com/file/d/1DxdcBLcoPDeSthl9FZpxU9tgssXkjtga/view?usp=sharing

    • This reply was modified 8 months, 1 week ago by hweill.
    Thread Starter hweill

    (@hweill)

    In case I haven’t explained properly i want to show in the email of the people who selected sessions the following:

    We are so excited that you are joining us for this special program.

    Please find the link to each class below:
    LABEL
    VALUE

    LABEL
    VALUE

    LABEL
    VALUE

    Plugin Support Nebu John – WPMU DEV Support

    (@wpmudevsupport14)

    Hi @hweill,

    An out of the box solution is not available for this.

    However, I have asked our developers to check if a workaround could be suggested and we’ll update you here once we have feedback on this as soon as possible.

    Kind Regards,
    Nebu John

    Plugin Support Kris – WPMU DEV Support

    (@wpmudevsupport13)

    Hi @hweill

    We have some updates from our SLS Team and such a workaround is out of the scope of support. We suggest to hire a developer in that matter.

    Kind Regards,
    Kris

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Adding both labels and values to an email’ is closed to new replies.