in reply to Re: Replacing a [TAG] in a Email Template
in thread Replacing a [TAG] in a Email Template

I figured it out. I just had to reset the template to its original layout by re-opening the template after sending each email.
print MAIL $sendthis, "\n"; close (MAIL); open (FILE, "$datadir/sendme.txt") || &error_message("Can't file temp +file for sending mail - $datadir/sendme.txt."); $sendthis = <FILE>; close(FILE); } }
Have a Happy Easter!

Replies are listed 'Best First'.
Re: Re: Re: Replacing a [TAG] in a Email Template
by pinetree (Scribe) on Apr 19, 2003 at 05:05 UTC

    Instead of re-reading your template file each time (remember - disk I/O is expensive), read the template once and then manipulate a copy for each email you send. Take a look at the following (very rough code)...

    $sendthis = <FILE>; foreach my $mailrecord (@list_of_addresses_and_names_etc) { my $msg = $sendthis; # manipulate the $msg and send }