JavaScript expressions in message templates

You can generate dynamic, personalised message content in your STACKED drip campaign messages using inline JavaScript expressions.

By wrapping your code inside _((<expression>))_, STACKED evaluates the expression at send time and inserts the generated text directly into your connection request or message.

This is especially powerful when you want to tailor links, landing pages, or any content based on profile data such as the company name.


Drip Campaign example


For example, if you maintain a list of companies with matching landing pages:

  "Dux-Soup": "https://dux-soup.com",
  "Dinoshirt.com": "https://landingpage.dinoshirt.com/",
  "Autodesk": "https://landingpage.autodesk.com/",
  "Wagner Soft": "https://landingpage.wagnersoft.com/"
You can embed logic directly into your campaign message to automatically select the correct URL.

JavaScript expression used in STACKED message templates.

Full message:

Hi _FN_ we just recently did a new landing page for you which you can find here _((()=>{let rv="https://generic.landing.page/";const pages={"Dux-Soup":"https://dux-soup.com","Dinoshirt.com":"https://landingpage.dinoshirt.com/","Autodesk":"https://landingpage.autodesk.com/","Wagner Soft":"https://landingpage.wagnersoft.com/"};let comp=(CN||"").toLowerCase();Object.keys(pages).forEach(k=>{if(comp.indexOf(k.toLowerCase())>-1){rv=[pages[k]]}});return rv})())_  let me know your thoughts.