Jump to content
  • 0

Pass a WordPress Email to Caspio Bridge


TJJones
 Share

Question

1 answer to this question

Recommended Posts

  • 0

Hello @TJJones,

to pass users details  from Wordpress to a data page accepting external parameters I use some javascript in Wordpress collecting user data and building the script used to display Caspio datapage.  I use such Javascript to build, with the Worpress plugin Snippets an ad-hoc  shortcode used into Wordpress pages. Here is how I work:

1. Assume that my datapage use as external parameter [@usremail] and the deploy code is

<script type="text/javascript" src="https://c2xxx999.caspio.com/dp/vd9990009990009990009990099/emb"></script>


2. I create a new snippet with this code

function show_my_datapage( $atts ) {
    global $current_user, $user_login;
   	get_currentuserinfo();
	add_filter('widget_text', 'do_shortcode');
	if ($user_login) 		
		return '<script type="text/javascript" src="https://c2xxx999.caspio.com/dp/vd9990009990009990009990099/emb?usremail='.$current_user->user_email.'">display_name></script>';
	else
		return '<a href="' . wp_login_url() . ' ">Login</a>';	
}
add_shortcode( 'insert_my_datapage', 'show_my_datapage' );

3. I use into my Wordpress page the shortcode [insert_my_datapage]

With this method I can use all data from $current_user and fill as many parameters I need.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...