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:
- href=’http://domain.tld/?key=[question(“value”), id=”2″]’
- href=”http://domain.tld/?key=[question(‘value’), id=’2’]”
In both scenarios, the link is mangled. This is what happens:
- href=”http://domain.tld/?key=[question("value"), id="2"]”
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.
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 = ‘firstname.lastname@example.org’;
%%htmlBody = “<a style=\”font-family: ‘Open Sans’\” href=\”http://domain.tld/?key=” . %%key . “\”>Link text</a>”;
sgapiEmailSend(%%email, ‘John Doe’, ‘email@example.com’, ‘Do Not Reply’, ‘Subject’, ‘Text Body’, %%htmlBody, ‘firstname.lastname@example.org’, ‘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.
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!