mailto: link works in edit mode but not after save?

I'm working on a Knowledge Base Space and had an idea that service would be enhanced if a support link could be emailed right from the sight. After some trial & error I created this link:

mailto:?subject=iPhone Screen Rotation&body=Hello,%0D%0A%0D%0AHere is the link to some more information.%0D%0A%0D%0ATo view it, please click the following link:https://support.apple.com/en-ca/HT204547.%0D%0A%0D%0AThank You.%0D%0A%0D%0A

It works in edit mode but stops being a link once I hit save.

Does anyone know how I can preserve the link on the page?

 

7 answers

1 accepted

1 vote
Accepted answer
Steven Behnke Community Champion Aug 02, 2016

Yes exactly. Can I ask if you're on Confluence Cloud or Confluence Server? I have a quick workaround but it only works on Confluence Server.

If your instance of Confluence has the {html} macro enabled, you can enter the HTML manually – 

<a href="mailto:?subject=iPhone Screen Rotation&body=Hello,%0D%0A%0D%0AHere is the link to some more information.%0D%0A%0D%0ATo view it, please click the following link:https://support.apple.com/en-ca/HT204547.%0D%0A%0D%0AThank You.%0D%0A%0D%0A">Text here</a>

I haven't found a way around Confluence stripping it out yet.

I'm just becoming familiar with Confluence. How would I go about requesting that they fix the stripping problem? It wouldn't be so bad if it also didn't work in edit, but it does sad.

Steven Behnke Community Champion Aug 02, 2016

I'm looking around the web – There's related questions here on Answers but none seem to have a distinct feature-request linked to them.

I have a theory – The Confluence editor is based on TinyMCE – I believe TinyMCE supports this style of links but the XML format Confluence uses doesn't. I actually believe this style of link is generating invalid XML markup, so Confluence rejects it.

I think you should also look into User Macros – Administrators in your system can define a new User Macro which you can input parameters into. This could possibly be a good and fast work-around, if you're able to add these.

Steven Behnke Community Champion Aug 02, 2016

There appears to be an older Bug Report here – https://jira.atlassian.com/browse/CONF-24880

It's a little out of date – The editor has changed since then, thus the bug presents differently than described in the Bug Description. The presented workaround in the comments appear to be to use User Macros or to escape the characters properly. I am not sure if they still are applicable. 

Hi Steven

I've copied the space over to our UAT environment (where I have more admin privileges). The HTML macros are enabled, and I've copied the HTML from your previous post. When I try the link, it still strips the code and in edit mode, it now goes to a page not found error.

Any ideas on what I can try now?

Steven Behnke Community Champion Aug 05, 2016

Arghh!! I thought I had it worked out – 

Mine works properly, the exact example I used. To be more specific, I'm using Confluence 5.9.5. I would imagine (but could be wrong) that it would work for you too. If you changed something, could you post the new content so we can inspect it?

0 votes
Steven Behnke Community Champion Aug 02, 2016

can you post the link in a {noformat} macro so we can see the URL in it's full glory?

Is this what you're looking for?

 

mailto:?subject=iPhone Screen Rotation&body=Hello,%0D%0A%0D%0AHere is the link to some more information.%0D%0A%0D%0ATo view it, please click the following link:https://support.apple.com/en-ca/HT204547.%0D%0A%0D%0AThank You.%0D%0A%0D%0A

mailto:?subject=iPhone Screen Rotation&body=Hello,%0D%0A%0D%0AHere is the link to some more information.%0D%0A%0D%0ATo view it, please click the following link:https://support.apple.com/en-ca/HT204547.%0D%0A%0D%0AThank You.%0D%0A%0D%0A

We're on a Confluence server (recent update I think). How can I find out if the HTML macro is enabled and if it isn't are there very explicit instructions I can pass onto our admins?

0 votes
Steven Behnke Community Champion Aug 02, 2016

I would suggest trying to insert the macro from the Insert > Other Macros dialog. If it doesn't appear, it is disabled still.

The admin must find the HTML macro add-on and enable the HTML macro module. The documentation is located here – https://confluence.atlassian.com/doc/html-macro-38273085.html

Not sure if this is too simplistic for whatever you are trying to do

But just type or paste the email address into the body of the page - in normal view when the User clicks the email address it will open a blank email for them.

Or another method is to create a "template" email on your PC complete with To, CC, subject, text and attachments ...
Then (I know I can do this in Outlook) just select that draft and drag it on to your desktop - it becomes its own ".msg" file.
Now attach that file to your Confluence page.
When a User clicks the ".msg" file link on the page, it opens up a copy of the template email for them to edit and send.

 

I'm still seeing this problem in Confluence Cloud.  The link worked until I published the page, then it gets scrubbed.   I may try the .msg file as a workaround.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Nov 29, 2018 in New to Confluence

How to use Confluence Cloud for stakeholder management

Most of us don’t need much convincing that stakeholder management is important. It just makes sense that keeping everyone in-the-know on projects and assigning clearly defined roles is key to having ...

1,120 views 2 6
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you