September 5, 2003MT Tweak: More Meaningful Comment NotificationsOne of the things that always annoys me about MovableType, is that every time I upgrade most of my customizations to the code go right out the window. The last major update to MT wiped out one of my favorites, my "More Meaningful Comment Notifications" tweak. Things changed in the actual code to such a degree, that simply cutting and pasting my modification would no longer work. Bummer. Well, after letting it stew and bother me for many months, I finally sat down and took a good look at the code. Now I don't do a lot of MT Tweaks, simply because I am not a Coder. Ask anyone at ScriptyGoddess, I am an idea man. I come up with wild ideas and somehow, they come up with amazing results. But there are times that I just don't feel right asking for something, mostly because I know it is within my reach. In this case, I had done it before, and now I had to knuckle down and figure out how to do it again. So, here's the problem: I really, really dislike the default format of the mail MT sends you when you get a comment. It looks something like this: Subj: [PromoGuy dot Net] New Comment Posted to '7 x 14 + 2 = 100 Things Aboot Me' ---------------------------------------------------------------- A new comment has been posted on your blog PromoGuy dot Net, on entry #1489 (7 x 14 + 2 = 100 Things Aboot Me). http://www.promoguy.net/archives/001489.php IP Address: 207.46.245.222 Comments: Hey! Where's the rest?? You promised! :) Slackerboy! -- The problem? The Subject line it too long and doesn't tell me what I need to Second problem? Not enough information in the Body of the message. I get a So, after my modifications, my Comment Notifications look like this: Subj: [7 x 14 + 2 = 100 Things Aboot Me] by "Lisa" - PromoGuy dot Net "Lisa" left a new comment in your blog PromoGuy dot Net, on entry #1489 (7 x --
When looking in your Inbox at the subject lines, which is more meaningful? NEW: [7 x 14 + 2 = 100 Things Aboot Me] by "Lisa" - PromoGuy dot Net OLD: [PromoGuy dot Net] New Comment Posted to '7 x 14 + 2 = 100 Things But my changes reflect my preferences, yours may be different. 1. I don't need to see "New Comment Posted to" in my subject line. It takes 2. I want to know which post got the comment, so I put that first. I don't 3. On heavy comment days, my inbox is nearly bursting. Now when I see a The only major change in the Body was making the IP Address into a clickable Here is what I did. Again, once you see the changes I made, you will probably Disclaimer: Do this at your own risk. It should go fine, but you never First, FTP or otherwise navigate to your MT installation directory and find: Now, make a backup copy of Comments.pm (always make backups, yo). Open up Comments.pm in your favorite text editor (I use Go to Line 132 or search for "$author->email" (without the quotes) and you Be sure you are on the line that says "Subject =>" and we are ready to get Highlight and delete: Subject => '[' . $blog->name . '] ' . Replace it with: Subject => '[' . $entry->title . '] ' . Now if you want to Tweak the Body of the message, scroll down to about Line I edited the body of the text to lead with the Comment Author's name. So my $body = $app->translate( To this: my $body = $app->translate( If you want to investigate their IP address, put your cursor right under $app->translate('IP Address:') . ' ' . $comment->ip . "\n" . and hit enter, making a blank line. Now copy and paste this: $app->translate('IP Info: http://www.samspade.org/t/lookat?a=[_1]', Save the file, making sure it has the .pm extension. Save it back to the same Now go leave yourself a comment. See how much more meaningful those Comment Hope this makes life a little easier. Next time: More Meaningful Trackback Ping Notifications! file this under Blog Tweaks Posted by on September 5, 2003 @ September 5, 2003 11:07 AM |
Cool tweak ... I might have to try my hand at it this weekend. I'm all over using MT Plugins, and have loads implemented on my site -- but haven't yet braved hacking the actual perl code. If I have problems, you're the first person I'm asking for help!!!!
Posted by: Lacy at September 5, 2003 3:45 PMI assumed that could be done but I had no way of figuring out how. Thanks for the tip. :D I tried it and got it to work. And yes, having the post's title as the subject does make it easier.
Posted by: Shawn at September 6, 2003 8:59 PMI need to bookmark this for later implementation... thanks for the hack! :)
Posted by: Mariann at September 8, 2003 8:58 AM