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

2 Comments

Hi,

For about an hour now I've been trying to find information on tags used in Movable templates, until I stumbled onto this post you wrote a few months ago.

It seems that if I want to use a tag, I have to 'declare' it in perl first. Is that correct? This would explain why tags I took from other .tmpl files won't work in my notification.tmpl (I installed MT-Notification tonight) ... and would mean I have to go into the MT-Notification source and 'export' those variables I need as well.

I want the 'notification mails' to simply be full-content mails, hence my interest in changing the template :-)

I'd appreciate it if you could tell me if I'm right.

Thanks,

Rob

Amsterdam (NL)

Yes, as far as I understand this is correct. In order to use certain tags in your email notification template (notification.tmpl) they first have to be "declared" (or whatever) in Notifier.pm. I use MT-Notifier and got a couple tweaks working for my email template, but honestly it is a little "over my head" so I have not gotten too far with it.

Here's an example of one small hack to MT-Notifier...

In my subscriber's email notification, I wanted a link to the blog being referenced:

First I inserted the following line in two places (around lines 293 and 339) in extlib/Everitz/Notifier.pm:

    blog_url => $blog->site_url,

Then I inserted the following as the first line in tmpl/email/notification.tmpl:

A new entry has been posted on <TMPL_VAR NAME=BLOG_NAME> at <TMPL_VAR NAME=BLOG_URL>

I hope that makes sense (and I hope it still works with the latest versions of MT-Notifier and MT).

Leave a comment

About this Entry

This page contains a single entry by Kate published on March 2, 2005 6:48 PM.

mtentries lastn alternatives was the previous entry in this blog.

display categories in category archive is the next entry in this blog.

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