[imp] Customizing trailer filename with variable
Gary
witscher at gmail.com
Tue Aug 6 01:07:37 UTC 2013
Hi,
I've been experimenting with the trailer file_get_contents feature. I
have fortune, running under cron, updating a text file with a new a
fortune each time. The file is appended to my sent email by the
trailer function in imp/hooks.php. This is exactly what I want it to
do, except for one problem.
It would be better if I was able to choose which fortunes got appended
to my sent emails dependent on the identity (or email addresses) of
the sender. I don't want offensive fortunes attached to business
emails, while for personal emails those fortunes are acceptable (and
the other way around too). I could do this easily if I could use a
variable in the trailer function that held either the identity or
email address of the sender. That variable could be used to make the
filename for the fortune text. The fortune program can easily be made
to produce content specific text files that would match these names.
Unfortunately, while I can do some programing, I'm not familiar with
php at all. To test the value of what looked like a known variable I
tried using $address, but it doesn't seem to have a value:
public function trailer ($address)
{
return "\n address = " . $address;
}
This appends "address = " to my sent email.
Anyone know of a way to accomplish what I have in mind? Or maybe there
is a more direct and easier method that will give me the same results?
TIA,
Gary
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: PGP Digital Signature
URL: <http://lists.horde.org/archives/imp/attachments/20130806/45c8c2bb/attachment.bin>
More information about the imp
mailing list