Michelle
Michelle

Reputation: 249

Kentico - Add page identider/title as subject line in email link

On every page I have an email link which links to [email protected]. What I'd like is to add some identifier to the subject line so that sales people know from what page the email was sent (if the subject line is not edited/deleted). Although don't think page title is the best one since it's pretty long, I'm not sure what else can be used and whether it's possible. Thanks for your help!

<a href="mailto:[email protected]?subject=Website%20Inquiry: {% Some page identifier #%}">

Upvotes: 0

Views: 74

Answers (2)

Brenden Kehren
Brenden Kehren

Reputation: 6117

In order for the proper link to be rendered you need to encode the output of the field. For instance:

<a href="{%UrlEncode("mailto:[email protected]?subject=Website%20Inquiry:" + CurrentDocument.DocumentName)#%}">Click here</a>

You can also use a specific page field like so:

CurrentDocument.GetValue("YourColumnName")

So if you added a new field specifically for the subject, it could be used.

Upvotes: 0

probrandono
probrandono

Reputation: 528

You can use something like the following if you'd like:

{% CurrentDocument.DocumentName #%} (ex: "Our Company")

{% CurrentDocument.DocumentNamePath #%} (ex: "/About/About Us/Our Company")

It depends how detailed you want to be, but you can get any info from the page that you want by using the macro.

Upvotes: 0

Related Questions