How to create link to email topic URL

This forum is for all Flare issues related to the HTML5, WebHelp, WebHelp Plus, and Adobe Air Targets
Post Reply
TR Lisa
Sr. Propeller Head
Posts: 100
Joined: Thu Jul 06, 2017 8:09 am

How to create link to email topic URL

Post by TR Lisa »

This seems simple but I can't find an answer. Need to add a link to my master page so that users can share topic URLs via email. So, click the link, it opens their default email app, topic URL is populated in the email body, and they can send it to whoever they want. What obvious solution am I missing today? :)
ChoccieMuffin
Senior Propellus Maximus
Posts: 2630
Joined: Wed Apr 14, 2010 8:01 am
Location: Surrey, UK

Re: How to create link to email topic URL

Post by ChoccieMuffin »

I have the following stuff in my master page template. This script checks the SVN revision number and shoves it in too, so you could probably chop this down.

<script type="text/javascript">/*<![CDATA[*/document.write("<a href='mailto:XXXX_REQUIRED_EMAIL_ADDRESS_XXXX?subject=Customer%20Feedback%20("+document.title+")%20Build:%20$WCREV$&body=Topic%20Reference%20(XXXXCOMPANY NAMEXXXX%20use%20only):%20"+location.href+"%0A%0APlease%20enter%20your%20comments%20below:%0A%0A'>Send feedback on this topic</a>");
/*]]>*/</script>

Hope that's a useful starting point.
Started as a newbie with Flare 6.1, now using Flare 2023.
Report bugs at http://www.madcapsoftware.com/bugs/submit.aspx.
Request features at https://www.madcapsoftware.com/feedback ... quest.aspx
TR Lisa
Sr. Propeller Head
Posts: 100
Joined: Thu Jul 06, 2017 8:09 am

Re: How to create link to email topic URL

Post by TR Lisa »

Thank you for the code snippet. I will try it out in a bit. My first attempt throws a Flare error but I can't do any troubleshooting until later today or tomorrow. I'm a little surprised that emailing is not an included topic toolbar function!
NorthEast
Master Propellus Maximus
Posts: 6359
Joined: Mon Mar 05, 2007 8:33 am

Re: How to create link to email topic URL

Post by NorthEast »

TR Lisa wrote:I'm a little surprised that emailing is not an included topic toolbar function!
So do you want a link or a topic toolbar button?

CM's example is a hyperlink, that you could put in your master page (or topic).

If you want an email toolbar button, just add your own button to the toolbar in the skin editor, then for the button Click action use something like:

Code: Select all

document.location.href="mailto:?subject=Read this: " + document.title +"&body=Link: " + location.href;
TR Lisa
Sr. Propeller Head
Posts: 100
Joined: Thu Jul 06, 2017 8:09 am

Re: How to create link to email topic URL

Post by TR Lisa »

Thank you Dave. A button would be nicer I think. In the past we just used an image on the master page because we didn't have a topic toolbar. But now that I'm doing a complete content and design refresh I'd like to add a topic toolbar for printing, expanding, emailing the link, etc. I'll give your suggestion a try. I was having trouble getting the topic URL to populate in the email. It was working at one time (in the code project I inherited) but I discovered recently something broke and I'm trying to fix it in the old and do it right in the new.
eknell
Jr. Propeller Head
Posts: 5
Joined: Wed Sep 23, 2015 6:58 am

Re: How to create link to email topic URL

Post by eknell »

I use the "Feedback" button feature in the topic toolbar that includes the topic URL in the body of the email. I have a business partner that would like additional text to display to help "guide" the feedback. I know I can create a link and add to the master page, but they are adamant about including the topic URL. Suggestions?
NorthEast
Master Propellus Maximus
Posts: 6359
Joined: Mon Mar 05, 2007 8:33 am

Re: How to create link to email topic URL

Post by NorthEast »

eknell wrote:I use the "Feedback" button feature in the topic toolbar that includes the topic URL in the body of the email. I have a business partner that would like additional text to display to help "guide" the feedback. I know I can create a link and add to the master page, but they are adamant about including the topic URL. Suggestions?
The examples above already include the URL of the topic - that's inserted by the location.href
eknell
Jr. Propeller Head
Posts: 5
Joined: Wed Sep 23, 2015 6:58 am

Re: How to create link to email topic URL

Post by eknell »

I understand that location.href is the key to including the topic URL, and I am able to successfully use the location.href when I edit the topic toolbar Feedback button. What is the key to getting the location.href to generate the topic URL in an email hyperlinked from that topic?
ChoccieMuffin
Senior Propellus Maximus
Posts: 2630
Joined: Wed Apr 14, 2010 8:01 am
Location: Surrey, UK

Re: How to create link to email topic URL

Post by ChoccieMuffin »

eknell wrote:I understand that location.href is the key to including the topic URL, and I am able to successfully use the location.href when I edit the topic toolbar Feedback button. What is the key to getting the location.href to generate the topic URL in an email hyperlinked from that topic?
When the email is generated, both location.href and document.title are substituted with the actual location and title, so you don't have to DO anything.
Started as a newbie with Flare 6.1, now using Flare 2023.
Report bugs at http://www.madcapsoftware.com/bugs/submit.aspx.
Request features at https://www.madcapsoftware.com/feedback ... quest.aspx
Post Reply