Kevin
Posts: 0
Joined: Sun Oct 07, 2012 7:58 pm

Include dynamic variables on Postmark's API email body

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?

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

Include dynamic variables on Postmark's API email body

Just read the values from local storage:

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

Kevin
Posts: 0
Joined: Sun Oct 07, 2012 7:58 pm

Include dynamic variables on Postmark's API email body

Thanks Max. It worked.

Kevin
Posts: 0
Joined: Sun Oct 07, 2012 7:58 pm

Include dynamic variables on Postmark's API email body

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?

Kevin
Posts: 0
Joined: Sun Oct 07, 2012 7:58 pm

Include dynamic variables on Postmark's API email body

Thanks Marina this is what worked for me :)

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

Return to “Issues”