How do I add an email link in sugarcube?

Essentially I want on the title page a few external links, and the site link seems to work fine but testing has the email link doing funny things:

[[authorname|mailto:joe@blow.com]]

What am I doing wrong? Additionally is there any way to add a default subject? Like I want anyone emailing me from the story link to have a clear indication that’s where it’s from.’

Edit: To whoever does the ‘best answer’ thing? Thank you for that feature. As someone searching for solutions and tutorials to grab? That ‘oh hey this is the question. this is marked as the best answer. YAY no digging through a scroll of posts.’

An email link isn’t the same as a passage link, so you’ll have to use HTML for that. You’ll need to have something like this:

<a href="mailto:joe@blow.com">authorname</a>

To add a default subject line, such as “Big News”, you’d do this:

<a href="mailto:joe@blow.com?subject=Big%20News">authorname</a>

(The “%20” is a URL encoded “space”. See here if you need to URL encode your subject line.)

If you want to include other information with that email message, take a look here.

Hope that helps!

2 Likes

Thanks man. That takes care of the problem nicely.

It should be noted that such links only work correctly if the end-user’s web-browser/operating system has been pre-configure to have a default email client, which isn’t always the case especially if they only use web based email client.

1 Like