Page 1 of 1

Include dynamic variables on Postmark's API email body

Posted: Wed Oct 24, 2012 7:26 pm
by Kevin

Hello,

I've set up Postmark to send emails from my app successfully.

http://developer.postmarkapp.com/deve...

I'm wondering how i can do some customization (maybe custom JS and mapping) to the HtmlBody request parameter so that I can send an email like this:

{username} has posted a new {post_title} under {category}

How can I include these variables which will be available on local storage?


Include dynamic variables on Postmark's API email body

Posted: Wed Oct 24, 2012 7:54 pm
by maxkatz

Just read the values from local storage:

code
localStorage.getItem('username');
/code


Include dynamic variables on Postmark's API email body

Posted: Thu Oct 25, 2012 12:58 pm
by Kevin

Thanks Max. It worked.


Include dynamic variables on Postmark's API email body

Posted: Thu Oct 25, 2012 1:03 pm
by Kevin

I have another question:

One of the values I want to read is from a select menu:
but if I use this code codevar cat = Tiggzi('category').val();/code

I get the value of the option selected. But what I'm interested in is the option label. How do i read the option label?


Include dynamic variables on Postmark's API email body

Posted: Thu Oct 25, 2012 1:30 pm
by Maryna Brodina

Include dynamic variables on Postmark's API email body

Posted: Thu Oct 25, 2012 4:43 pm
by Kevin

Thanks Marina this is what worked for me :)

code $('#yourdropdownid').children("option:selected").text();/code