Use Session Variable in Javascript

I have a javascript function in which i want to set emailId = session variable

This works but

<script type="text/javascript">
        function openCheckout3() {
    		Paddle.Checkout.open(
                { 
                product: 24102,
                email:"abc@gmail.com"
                }
             );
    	}    	
    </script>

When i try to set the email from session variable it does not work

<script type="text/javascript">
        function openCheckout3() {
    		Paddle.Checkout.open(
                { 
                product: 1000,
                email:"session1.data.emailId"
                }
             );
    	}    	
    </script>

What am i doing wrong?
Thanks

You need to use dmx.app.data in front of it and remove the quotes.


email: dmx.app.data.session1.data.emailId

If the session element is in a content page then add content before session1.

1 Like

This worked thanks!

1 Like