Whispered Ink

Adding a "reply via email" button to Bear Blog

There's a bit of controversy among the users of Bear Blog concerning whether visitors should be able to comment or not on blog posts. I don't think we should have comments (they are more of a hassle to moderate than useful), but it's nice to receive feedback and start conversations with the readers. 

A "Contact" item already exists on the main menu, but in most cases there's a specific post that sparks a discussion and motivates whoever's reading to send an e-mail. I saw an "reply via email" button on Luke Harris' blog and also on micro.blog, so I wanted to throw one in here as well.

It's simple: I add this line to the end of each blog post:

##### [Reply via email](mailto:myawesomeemail@provider.com)

I've styled the h5 tag to look like a button, because I don't think I will use h5 heading anywhere else.

I would also like to add a default email subject to the message, but unfortunately I couldn't get mailto:myawesomeemail@provider.com?subject=Re:%20Adding%20a%20reply%20via%20email%20button%20to%20bear%20blog to work. I think this is a limitation in the markdown markup. 

I'm really happy with this reply button, though.

Updated in 2024-01-05: Thanks to those of you who read this, I was able to make some improvements: if I use HTML instead of markdown, I can include the subject line AND use the post attribute tag, which will add the corresponding post title automatically:

{{ post_title }}

The improved version is this one:

<h5><a href="mailto:myawesomeemail@provider.com?subject=Re:%20{{ post_title }}">Reply via email</a></h5>

I'm inserting the code manually at the end of each blog post, because post templates are not working for me. Maybe it's a bug. This isn't a big issue, because I can use AutoHotkey to write the whole code easily: I just need to input the keyword I've created for it (for example, ;rvm) and AHK replaces it with the whole HTML code.

As a Bear Blog subscriber, I could also insert the code on the blog's footer and it would be displayed in all pages, but I'm still thinking about what to do with my footer and I like to have the button above the post tags.

Updated in 2024-01-06: To prevent spam I'm using an email alias on the reply button instead of my personal email address.

Updated in 2024-01-14: Post templates work fine. I didn’t know you had to insert the following before the template text itself:


Updated in 2024-01-18: If you are a Bear subscriber and want to add the code to the footer while hiding it from both the home and posts' list (blog) pages, you can use display: none; in the CSS, like this:

body.home footer #footer-directive h5 {
display: none;

body.blog footer #footer-directive h5 {
display: none;

Special thanks to:

Reply via email

#bear.blog #blog #blogging #tips