[Solved] What is the proper way to include merge code within a hyperlink when using a Send Email action?


When a user fills out a survey, a Send Email action is fired. The email has a link that should include the value of question #2. I’ve tried two different ways to define my link:

  1. href=’http://domain.tld/?key=[question(“value”), id=”2″]’
  2. href=”http://domain.tld/?key=[question(‘value’), id=’2’]”

In both scenarios, the link is mangled. This is what happens:

  1. href=”http://domain.tld/?key=[question("value"), id="2"]”
  2. href=”#”

Either way, the resulting email produces an unusable hyperlink. There are no options within the Send Email action to prevent SurveyGizmo from altering the HTML that I am entering.

What is the proper way to include merge code within a hyperlink when using a Send Email action?


Edit: To be clear, SurveyGizmo’s forum software is adding the styling to the quotes. I am not using curly quotes in my source code.



Will Di selected answer

    Best answer


    Thanks for the response Dominic. I did come across that article, but it doesn’t apply to Send Email Actions because that option doesn’t exist (there is no Layout tab).

    However, I did find a way to accomplish this by way of a Custom Script Action. I wrote one that looks something like this:

    %%key = sgapiGetValue(2);

    %%email = ‘someemail@fakedomain.tld’;

    %%htmlBody = “<a style=\”font-family: ‘Open Sans’\” href=\”http://domain.tld/?key=” . %%key . “\”>Link text</a>”;

    sgapiEmailSend(%%email, ‘John Doe’, ‘donotreply@domain.tld’, ‘Do Not Reply’, ‘Subject’, ‘Text Body’, %%htmlBody, ‘donotreply@domain.com’, ‘HTML’);

    Although I can no longer use Send Email Action’s HTML editor using this method, it does let me send the querystring parameters that I need for the link.

    Thank you.

    Will Di edited answer

      I’m not sure if you have referred to this article, but it offers some best practices for using merge codes within HTML:


      Hopefully this points you in the right direction!

      Dominic Sharpe answered


        Question stats

        • Active
        • Views3395 times
        • Answers2 answers
        • Followers1 follower