Originally {{questionnaire.unsubscribe}} placeholder was designed to be used at Invitation Email template (invitation emails). However later some of our customers would like to expand this functionality by using the {unsubscribe} placeholder into survey (questionnaire) layout. For such cases you can use the following solution (workaround).
In order {unsubscribe} placeholder to be expanded correctly within the layout of your survey ("Global settings" ->" WEB Layouts") please add this JavaScript code snippet after the last </div> and before </body> tags into "HTML source editor" of your layout:
<script type="text/javascript">// <![CDATA[
$('a[href="{{questionnaire.unsubscribe}}"]').attr("href", window.location.href + '/unsubscribe')
// ]]></script>
The final version (the footer of your HTML code) should look smth. like this:
<body>
<div id="wrapper">
<div id="content">
<div id="Logo"><img src="https://feedback-static.sandsiv.com/demo/orig/some_image.jpeg" style="float: left;" />
<div style="float: right; padding-top: 15px;">{{status_bar}}</div>
<div style="clear: both;"></div>
<br /><hr /></div>
<div id="question_text">{{question_text}}</div>
</div>
Click <a title="Unsubscribe link" href="{{questionnaire.unsubscribe}}" target="_blank">here</a> to unsubscribe.
</div>
<script type="text/javascript">// <![CDATA[
$('a[href="{{questionnaire.unsubscribe}}"]').attr("href", window.location.href + '/unsubscribe')
// ]]></script> </body>
</html>
And using this solution the unsubscribe placeholder would be expanded to smth. like this:
https://{customer}-survey.sandsiv.com/{questionnaire_hash}/unsubscribe
Important note
Older placeholders will remain active but any changes to affected survey fields will require new placeholders (including newly created surveys). In such case you'll see a toolpit "Old placehoders are deprecated and can't be used".
The placeholder {unsubscribe}
is also can be used as {{questionnaire.unsubscribe}}
but{unsubscribe_link}
can be used only as is.
Comments
0 comments
Article is closed for comments.