Feb 01

HTML Email for Comments, Trackbacks, etc.

I recently attempted my first plugin for WordPress. It’s nothing fancy, but it does something that I was unable to find elsewhere. On the recommendation (and with the tremendous help of) Otto42 on the WordPress support forums, I was able to accomplish my task!

When someone comments on my WordPress blog, WP sends me an email with the comment in it (typical of most blog systems). However, the emails were in plain text, so I didn’t see any formatting any of my commenters used. I also have a Scripturizer plugin installed that automatically converts Scripture references to links to BibleGateway’s site, and those couldn’t show up in the plaintext emails, either.

I looked quite a few times for something to convert those emails to HTML format, but to no avail. Finally, I posted on the support forums about it, and Otto42 told me that it could be accomplished by a plugin, and gave me the instructions on how to override pluggable functions in WP.

It only took a few hours to get the basic concept down, and after quite a bit of tweaking, I think I finally have it the way I want it.

Please bear in mind that this is my very first plugin ever, so there may be some things that need to be modified on it. There are absolutely no options to be set on this plugin yet, so it’s simply a plugin file to be installed and activated. Here are the instructions:

  1. Download the HTML Admin Email plugin here.
  2. Unzip the file (there is only one file in the zip archive) into your wp-content/plugins folder.
  3. Log in to your blog’s admin interface, click on Plugins, and activate the “HTML Admin Email” plugin.

That should be all there is to it. Next time someone leaves you a comment, trackback, or pingback, you should receive an HTML-formatted email with the formatting of the comment intact (provided that you already have your blog configured to email you comments, etc.).

This plugin is still very new, so I have labelled it as version 0.8. If I get some feedback on it, and end up making changes and creating an options page for it, I will make a 1.x version and make it really official. For now, though, please consider this as something of a beta. Any comments are quite welcome! :)

Update 2/4/07: I’m having very intermittent success (read: almost constant failure) with this plugin in version 2.1. I have no idea why, but it seems to be ignoring my plugin completely on all but 1 comment email. Hopefully I’ll be able to figure this out soon. Stay tuned!

Update 2/5/07: The problem actually was with Spam Karma 2, which also declares a function called wp_notify_postauthor to override the pluggable function. If you are running any kind of spam filter plugin, you may have a similar problem. You have two options, as I see it: 1) Delete the function from the spam plugin so that this one gets called, or 2) replace the function in the spam plugin with the one in my plugin. Either way can be tricky, and you will lose whatever functionality the other plugin wrote into that function.

Thanks!

steve :)

  1. Hey Steve,

    I’d like to use your plugin to format the notifications coming to me, but I’ve got to figure out how to get those notifications. As far as I can tell, I simply have to plugin the wp_notify functions (both postauthor and moderator) somewhere, but I do not know where/how. I’m sorry if this question is a little off topic, but any help you could give me would be much appreciated.

    Thanks.

    Comment by Nick — February 5, 2007

  2. Nick, thanks for the note. In order to turn on comment and trackback notification, you need to set the appropriate setting in your WP Admin. Log into your admin area, then go to “Options” and click on the “Discussion” subpage. On there is a checkbox for emailing you whenever “anyone posts a comment.” Make sure that is checked and then click the “Update Options” button (there is one at the top right-hand of the page, and one at the bottom right-hand of the page, they both do the same thing).

    The other thing that is necessary to get those emails is that you have a valid email address that you use to receive the notifications. This is set in your User Profile. Go to “Users” and then “Your Profile” in order to set that email address.

    Once you have those things taken care of, installing my plugin will override the default email function and cause those messages to be formatted in HTML.

    Does that information help? If not, let me know more specifically what you need help with, and I’ll do my best to help.

    steve :)

    Comment by Steve Sensenig — February 5, 2007

  3. is their a way to use this plug in so that the person leaving the comment gets a confirmation that their comment was received?

    Comment by marc — April 23, 2007

  4. marc,

    I’m sure it would be possible to notify the commenter themselves, but I’m not sure how annoying this would be to the commenter. And it’s kind of outside the scope of this plugin’s purpose.

    On the other hand, are you talking about a comment held for moderation? If not, a person can just look at the site and see their comment to know that it was received. Or am I completely misunderstanding?! :)

    If you give me more details, I can either point you in the right direction, or consider writing a plugin to do what you want.

    Comment by Steve Sensenig — April 23, 2007

  5. Hi Steve,

    This plug in stopped working after I upgraded to 2.2 or whatever version we are up to now. Please let me know if you figure out a way to get it to work again.

    Thanks!

    Comment by Liana — June 2, 2007

  6. Liana, I’m sorry to hear about this. I have not yet upgraded to 2.2, so I will have to find time to do that in a test environment soon and see what happens.

    I am curious, though. Did you recently install any other plugins? The reason I ask is that when I started using Spam Karma (instead of Akismet), my plugin stopped working because Spam Karma had their own “wp_notify_postauthor” function.

    If you did install some plugin that deals with post comments (such as Spam Karma), this could be the culprit instead of WP itself.

    The only other possibility is that WP is now using a different function. I’ll try to find out for you.

    Thanks for letting me know!
    steve :)

    Comment by Steve Sensenig — June 2, 2007

  7. To my knowledge I haven’t installed Spam Karma. I did install a program that allows me to e-mail replies to my commenter from the blog but your program worked fine after that. It stopped after upgrading Wordpress.

    Hope you find out something!

    Comment by Liana — June 21, 2007

  8. Hey Steve! Do you know of a plugin that sends a post via html email to a list of designated recipients? I’m putting a blog together for a missionary friend who is out in the field. He has never heard of a blog. Thus, he still wants the old fashioned html email update to go out. I was hoping to migrate him to a blog but have the posts automatically sent via email (as opposed to an email letting people know there is a new update). I know this is redundant, but it’s the only way I could convince him to half migrate his site to a blog format. Thanks for any and all help!

    Comment by Jake — June 27, 2007

  9. Jake,

    There are plugins that allow people to subscribe to posts through email, but I’m not sure how easy it is for you to add emails yourself.

    The solution I would suggest is publishing a blog and using Feedburner to manage the feed. Feedburner allows you to add emails to a subscription list, I believe, in which case any time a post is published, it will get sent to those email addresses.

    This sounds like exactly what you need.

    Comment by Steve Sensenig — June 27, 2007

  10. [...] Visit [...]

    Pingback by WP Plugins DB » Plugin Details » HTML Admin Email — August 13, 2007

  11. i love it! thank you for your work..i really love your plugin!

    Comment by manele — August 31, 2007

  12. .i really like this plugin :X

    Comment by manele noi — March 7, 2008

  13. All people deserve very good life time and business loans or small business loan can make it better. Just because freedom is grounded on money.

    Comment by VICKIEMelendez — March 11, 2010

  14. Good work, keep us posting, you are very good writer.

    Comment by Free tattoo designs — April 14, 2010

  15. I want to start my first blog, what cms do you use and recommend for me ?

    Comment by jackpotcity casino — April 15, 2010

  16. I see a lot of interesting articles here. Bookmarked for future referrence.

    Comment by laser hair removal nyc — April 17, 2010

  17. I am sure that i will come back here. Well written articles !

    Comment by laser hair removal nyc — April 19, 2010

  18. Your website looks good, what template is this ?

    Comment by unlock iPhone — April 19, 2010

  19. Thanks for writing this article. Now everything is clear for me.

    Comment by make money online — April 20, 2010

  20. Excellent post i am sure that i will come back here soon

    Comment by sts — April 25, 2010

  21. people good money

    Comment by free-motor — April 26, 2010

  22. I came across your article, i think your blog is cool, keep us posting.

    Comment by bingo uk — April 27, 2010

  23. Just have bookmarked your site, and waiting for the next interesting post

    Comment by solve quick tasks earn $$ — April 30, 2010

  24. Thanks for writing this article. Now everything is clear for me.

    Comment by gry planszowe — May 2, 2010

  25. Great blog , love the template. Seriously considering migrating to this blog platform now!

    Comment by busy do Niemiec z Gdyni — May 3, 2010

  26. Ciekawy artykul, bede wpadal na twoja strone czesciej zapewne

    Comment by busy do Niemiec ze Szczecina — May 3, 2010

  27. I think you are talented writer, keep us posting

    Comment by expekt — May 10, 2010

  28. I came across your article, i think your blog is awsome, keep us posting.

    Comment by Free tattoo designs — May 11, 2010

  29. Good work, keep us posting, you are good writer.

    Comment by free tattoo ideas — May 18, 2010

  30. Your website is very interesting. May i write article for you, could you publish it here ? Please mail me

    Comment by babylon 8 download — May 18, 2010

  31. Masz wiecej informacji na ten tamat ?

    Comment by zabawki dla dzieci — May 20, 2010

  32. Bardzo interesuj¹cy wpis. Bez w¹tpienia wpadnê jeszcze po wiêcej lektury. bertussklep4545

    Comment by zabawki dla dzieci — May 20, 2010

  33. What template do you use in your site

    Comment by totomix — May 20, 2010

  34. Only want to say your article is as tonishing. The clearness in your post is simply spectacular and i can take for granted you are an expert on this field. Thanks a million and please keep up the good work.

    Comment by Digital Camera Sports Photography — June 10, 2010

  35. Only want to say your article is as tonishing. The clearness in your post is simply spectacular and i can take for granted you are an expert on this field. Thanks a million and please keep up the good work.

    Comment by Burst Mode-Digital Sports Photography — June 10, 2010

  36. Great article! I am just starting out in all this and trying to learn more about it – resources like this article are incredibly helpful.

    Comment by Digital Sports Photography — June 15, 2010

  37. I simply wanted to say your blog is one of the nicely laid out, most inspirational I have come across in quite a while. Thx! :)

    Comment by Kimberly — June 16, 2010

  38. Recently, I didn’t give so much thought to writing comments on blog entries and have left comments even less. Checking out your informative page, will probably encourage me to do this more regularly.

    Comment by Digital Sports Photography Tips — June 25, 2010

  39. Hi. I am looking for guest authors towards the website my squad is almost certainly creating. If you’re interested, you know where to reach myself.

    Comment by dowload music — June 30, 2010

  40. Yeah,I think it is very good.
    thank you for your share.

    Comment by nike shox rivalry — July 2, 2010

  41. It is a good idea.
    thank you very much.

    Comment by tn requin — July 2, 2010

  42. I like your blog very.thak you.

    Comment by Silver Bracelets — July 2, 2010

  43. Would you be interested to be link partners?

    Comment by free credit card numbers — July 6, 2010

  44. I just discovered your web site from Zynga. Do you possess a type of monetary gift box where I will likely drop donation in PayPal? I would desire to reward you for your written content. :)

    Comment by free credit card numbers — July 7, 2010

  45. An indicator that you could possibly have very poor circulation in your legs is tinting of the skin. If you become aware of a blue, purple or pale region on your leg, then this may be a proof that the blood is not moving as well as it should really to the spot.

    Comment by Clarence Padol — July 16, 2010

  46. A signal that you may have very poor circulation in your legs is yellowing of the skin. If you become aware of a blue, purple or pale spot on your leg, then this may be an indication that the blood is not streaming as well as it should really to the spot.

    Comment by Hershel Benulis — July 16, 2010

  47. First thing’s first, thank you for offering me with the resource I’ve been seeking for. I’ve been surfing the net for three hours looking for it and would’ve even given money if I would have found your site any sooner. Not only did I find what I was searching for, but also found replies to doubts I never considered to ask myself. I appreciate for what you’ve done and for such a terrific site!

    Comment by Yukiko Josilowsky — July 18, 2010

  48. Hi there! We are wanting for incoming writers, could you be intrigued? This process might not help you prosperous only there is an appealing compensation and if you without a doubt love writing then that gig is for you.

    Comment by Pilipinas Win na Win — July 28, 2010

  49. I just stopped at your web from Squidoo. Do you enjoy a couple variety of gift box where I could ship monetary gift in PayPal? I would like to reward you for your articles and other content. :)

    Comment by Pilipinas Win na Win — July 28, 2010