Recently in MT Source Hacks Category

customize comment notification email

| 2 Comments

I tweaked the content of the new comment notification email to add a couple convenient links - one to the main index page of the blog to which the comment was posted and one directly to the approve url for the comment. FYI, I found the "blog_url => $blog->site_url" in MT/*/CMS.pm and edited its syntax for Submission.pm

add to MT/plugins/Blacklist/lib/Blacklist/App/Submission.pm around line 745 or so:
             blog_url => $blog->site_url,

add to MT/plugins/Blacklist/tmpl/new-comment.tmpl (insert as line 1):
Visit <TMPL_VAR NAME=BLOG_NAME> at <TMPL_VAR NAME=BLOG_URL>

Not using MT-Blacklist plugin?  make same changes to MT/MT/App/Comments.pm and MT/tmpl/email/new-comment.tmpl

similar process for approve_url - will post later

CC Comment Notifications

MT can be configured to send an email notification when new comments are posted. Sometimes it is useful to CC this notification to an alternate address. You can accomplish this with a teeny hack to lib/MT/App/Comments.pm as follows:

Find the first line and insert the second line directly beneath it:

my %head = ( To => $author->email, Bcc => 'email@domain.com',

FYI, you can alternately use CC and/or multiple comma-separated email addresses.

NOTE: There are TWO instances of this code in Comments.pm. Be sure to edit them BOTH!

If you are using MT-Blacklist, you can configure this plugin to add admins and send new comment notifications to them (in addition to or instead of the entry author). (thus rendering this hack unnecessary!)

About this Archive

This page is an archive of recent entries in the MT Source Hacks category.

MT Plugin Solutions is the previous category.

MT Style Tweaks is the next category.

Find recent content on the main index or look in the archives to find all content.