tag:help-archives.hannonhill.com,2010-02-09:/discussions/how-do-i/19573-how-do-i-create-a-mailto-link-with-a-subject-line-that-dynamically-fills-in-the-current-page-urlCascade CMS: Discussion 2015-09-25T17:04:10Ztag:help-archives.hannonhill.com,2010-02-09:Comment/380212812015-09-25T13:30:47Z2015-09-25T13:30:47ZHow do I create a mailto link with a subject line that dynamically fills in the current page URL?<div><p>Hi Rhonda,</p>
<p>I think you could accomplish this using a Velocity Format and
the <code>$currentPage</code> variable. Specifically, you could do
something like the following:</p>
<pre>
<code>#set ($emailSubject = "Cuyamaca College Website Feedback: ${currentPage.siteName}/${currentPage.path}")
<!-- Script for email protection generated at w2.syronex.com/jmr/safemailto/ -->
<script type="text/javascript"><![CDATA[#protect
var v1="";
var v2="I3XVYGRW3Q3Q2PAHJ4BJ5FJRJ6";
var v7=unescape("*F%2174%2616%1D%26V3F5%20%25%0AS%21%29V%22d7.C");
var v5=v2.length;
var v6="${_EscapeTool.url($emailSubject)}";
for(var v4=0;v4<v5;v4++){v1+=String.fromCharCode(v2.charCodeAt(v4)^v7.charCodeAt(v4));}
document.write('<a href="javascript:void(0)" onclick="window.location=\'mailto:'+v1+'?subject='+v6+'\'">'+'Website Feedback<\/a>');
#protect]]></script></code>
</pre>
<p>So basically use the <code>$currentPage</code> variable to
provide context for the calling page when generating the
JavaScript. Additionally, you can use the Escape Tool to generate
the subject string so it's easier to read/maintain.</p>
<p>Please let me know if you have any questions.</p>
<p>Thanks!</p></div>Ryan Griffithtag:help-archives.hannonhill.com,2010-02-09:Comment/380212812015-09-25T15:38:40Z2015-09-25T15:38:40ZHow do I create a mailto link with a subject line that dynamically fills in the current page URL?<div><p>Thank you, Ryan!</p>
<hr></div>Rhondatag:help-archives.hannonhill.com,2010-02-09:Comment/380212812015-09-25T17:04:10Z2015-09-25T17:04:10ZHow do I create a mailto link with a subject line that dynamically fills in the current page URL?<div><p>Not a problem at all, Rhonda.</p>
<p>I'm going to go ahead and close this discussion, please feel
free to comment or reply to re-open if you have any additional
questions.</p>
<p>Have a great day!</p></div>Ryan Griffith