tips and tricks for movable type

notification message URL
August 04, 2002

When you send a message to your notification list about a new entry, the link included points to the archived version of the entry.

Some people have wanted this link to point instead to their main page, or some other URL they specify. Ben explained where to hack the send_notify method in MT.

1. Open up lib/MT/App/CMS.pm in your text editor (saving a backup version is always wise!) and look for these lines (currently, at lines 2306-8):

my $link = $blog->archive_url;
$link .= '/' unless $link =~ m!/$!;
$link .= $entry->archive_file . '#' . sprintf "%06d", $entry->id;

2. If you want the link to point to your main page, change the lines to:

my $link = $blog->site_url;

3. If you want the link to point to some other URL, change them to:

my $link = "http://someurl.com/";

(Courtesy of Adam Kalsey in this support forum thread.)

4. Save lib/MT/App/CMS.pm and upload the new version to your server (in ASCII mode).

Comments

Do you happen to know which lines these are in 2.64? I have searched and can't find them! Thanks in advance and thanks for always helping out on the forums!

by Allie | 09.22.03 09:24 PM

I think it's line 2581, and it's changed:

$body .= $entry->permalink . "\n\n";

Try:

$body .= "http://someurl.com/" . "\n\n";

I think that will work.

by girlie | 09.22.03 10:03 PM

any way to change the foremat of the outputed text.

by boxx | 12.07.03 03:29 AM

This still works in 2.6.1 with the new entry line:

$body .= $entry->permalink . "\n\n";

Changed to

$body .= $blog->$site_url . "\n\n";

to go to the main site instead of another specified URL.

by Leslie | 06.29.04 05:26 PM

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)

TrackBack: 0
(URL: http://www.thegirliematters.com/sf/mt-track.cgi/65)