• Hi,
    I′m executing an own shortcode (php snippet=4) in a html-field. Online the shortcode is working correctly (output is a referrer url), but by sending the mailing with {summary} the output is not showing, but only the php shortcode itself (php snippet=4). How can transmit Caldera Forms the content of the shortcode in the summary mailing? Activating “Email Summary” is not the solution. Thanks a lot.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Dear @jugiii

    we also try to get the referrer url in a caldera form. Can you post how you solved it?

    Thanks in advance for sharing Marc

    Thread Starter jugiii

    (@jugiii)

    It works through detours. First install the plugin PHP Code for Posts, then create a new snippet with the following code:

    <?php
    session_start();
    if($_SERVER["SERVER_PORT"] == 443 )
        $http = "https://";
    else
        $http = "https://";
    if ( !isset( $_SESSION["origURL"] ) )
    {
        $_SESSION["origURL"] = $_SERVER["HTTP_REFERER"];
    }
    $var = $_SESSION["origURL"];
    add_filter( "caldera_forms_render_get_field", function( $field )  { 
    if( "fld_3267653" == $field[ "ID" ] ){ 
    	$field[ "config" ][ "default" ] = esc_url ( $_SESSION["origURL"] );
    } 
    return $field;
    	});
    return $var;
    ?>

    Then insert the shortcode of this snippet (e.g. [php snippet=4] on the page where the shortcode of the Caldera form is called, e.g. directly above. Then create a hidden field with any label in the form itself.
    Then use {summary} to output the contents of the hidden field. Important, otherwise it doesn’t work: copy the ID from the hidden field and paste it into the code. In my example this is the fld_3267653. Then delete the cache in the browser and try it out.

    If you want to use cookies instead of sessions please use COOKIE everywhere, e.g. $_COOKIE[“origURL”]

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Transmit shortcodes via mailing’ is closed to new replies.