Support » Plugin: Email Before Download » [Plugin: Email Before Download] Don't need when user is logged in

Viewing 6 replies - 1 through 6 (of 6 total)
  • Hi there,
    In CF7 there is the possibility to add “default values” in the form fields, this for EACH form. I modified the form as follows :

    <p>Votre nom (obligatoire) : [text* your-name default:user_display_name] </p>
    <p>Votre email (obligatoire) : [email* your-email default:user_email] </p>

    The form is still visible, but at least I will not bother the registered users….
    I am still interested in skipping the CF7 form if you find a solution.

    Plugin Author mandsconsulting

    (@mandsconsulting)

    Hi Manu-PB,

    Thanks your your note and updating your solution.

    Depending on what you are using that has users log in, there may be shortcode that hides/displays content ONLY for logged in users? For logged in users you can show a direct link and hide CF7…and for non-logged in users you can hide the direct link and show only the CF7. Just running into this scenario now, and will be testing it out to see how it works.

    @williambennettiv

    I have created a new shortcode which skips the CF7 form when user is logged in :

    Function show_download_link($article) {
    if ( is_user_logged_in() ) {
    $dlm_short = '[download id="' . $article[0] . '" format="format-coach"]';
    $affiche = '<br/><p>Cliquez sur ce lien pour visualiser le fichier : <span class="button-file-dl">' . do_shortcode ( $dlm_short ) . '</span></p></br>';
    }
    else {
    $ebd_short = '[email-download download_id="' . $article[0] . '" contact_form_id="460"]';
    $affiche = '<p>' . do_shortcode ( $ebd_short ) . '</p>';
    }
    return ( $affiche );
    }
    add_shortcode('my-dl-link', 'show_download_link');

    This must be added in the functions.php of your theme.
    Then use shortcode [my-dl-link Id] in your post.

    Hope it helps

    that looks good! I played around and am now using “Logged in User Shortcode” by Jack Lamb. Then I set up my code as follows:

    [loggedin]Since you are already logged in, here is the file: [download id="2" format="1"][/loggedin]
    [loggedout]We would really like to share this file with you -- would you please just share your email with us?
    [email-download download_id="2" contact_form_id="XXXX"][/loggedout]

    An extra step perhaps — but I can customize what is shown to whom. And shouldnt have to re-update the functions file on a theme update.

    Plugin Author mandsconsulting

    (@mandsconsulting)

    Hi williambennettiv,

    Leveraging the “Logged in User Shortcode” plugin seems like a great idea for this use case. Nice find and thanks for sharing. And, Manu-PB, thank you again for all your inputs. Very nice to see the community helping each other!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘[Plugin: Email Before Download] Don't need when user is logged in’ is closed to new replies.