• Resolved rudirodolfo

    (@rudirodolfo)


    Hello.

    When I call the form, I transfer the name of the page into a dynamic text field.
    [uacf7_dynamic_text image_number visibility:disabled “UACF7_POSTINFO”]
    This also works and is displayed in the form.

    In the mail that is sent I have the following code:
    [uacf7_dynamic_text image_number visibility:visible “UACF7_POSTINFO”]
    However, the content of the field is not displayed, only the code itself.

    How can I make it so that the field content is actually written in the mail?

    Thanks and greetings,
    Rolf

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

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author sevenspark

    (@sevenspark)

    Hi Rolf,

    Is “UACF7_POSTINFO” a custom shortcode that you’ve written? If so, what is your code? Are you sure you’re returning the proper value? (Shortcodes must return, not print/echo, their value).

    Without knowing any more, my best guess given what you’ve described is that you have a custom shortcode that is mistakenly echoing rather than returning its value.

    Plugin Author Tessa (they/them), AuRise Creative

    (@tessawatkinsllc)

    It sounds to me like you’re having a similar issue as this person, which is where you created a shortcode but not a CF7 mail tag.

    In order for shortcodes to work in a Contact Form 7 mail template, it needs to be added as a form tag like this:

    // Add the [au_shortcode] shortcode to CF7
    function au_init_wpcf7_shortcodes() {
        wpcf7_add_form_tag(
            array('au_shortcode'), // shortcode tag
            'au_shortcode_handler', // callback function
            array('name-attr' => true) // supported features
        );
    }
    add_action('wpcf7_init', 'au_init_wpcf7_shortcodes');

    For more information on creating custom form tags, you can read up on?Contact Form 7’s documentation about it here.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Dynamic-text in ContactForm 7’ is closed to new replies.