JavaScript expressions in message templates

You can generate dynamic, personalised message content in your Dux-Soup Pro, Turbo, or Cloud messages using inline JavaScript expressions.

By wrapping your code inside _((<expression>))_, Dux-Soup 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 (Turbo and Cloud UI):

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.

How to set up a drip campaign


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 

Pro UI example:

Using the following config, you can wish your 1st-degree connection a good day, and the script will generate the current day of the week.

Expression : 

_([ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" ][new Date().getDay()];)_

Results as they appear in the LinkedIn Inbox: