Re: [SMARTY] sending emails using my smarty templates

From: Date: Fri, 21 Jan 2005 18:57:40 +0000
Subject: Re: [SMARTY] sending emails using my smarty templates
References: 1 2 3 4 5 6 7  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-12192@lists.php.net to get a copy of this message
I had thought of using this.... http://uk.php.net/manual/en/function.dom-domdocument-loadhtml.php Using the new DOM functions you should be able to load the HTML and automatically extract all the <img> tags. The big BUT is... 1. I think it is only available in PHP5 2. I have not tested it Can anyone with PHP5 installed work out (or does anyone know) if this would in theory work? :) Abdul-Wahid On Fri, 21 Jan 2005 17:41:37 +0000, pete M <pmorgan@ukds.net> wrote: > Out of curioisty > Has any guru managed to extract the <img> tags from the mail_template > and attach them to the email automatically?? > > pete > > Jochem Maas wrote: > > Abdul-Wahid Paterson wrote: > > > >>> why not just fetch() the output of the template and stick that in a mail > >>> (using whatever mail class/function/wrapper you have/use) rather than > >>> display()ing the output? > >>> > >> > >> > >> Yes, that is what I am planning. The only thing though is that I will > >> need to filter the output to find the images as my specification says > >> that images should be included to in the email and not linked to from > >> the web-server. > > > > > > once you have found the images you also have to change the src attribs > > AND attach the image. I would recommend that you use phpmailer. create a > > subclass that filters the body before sending and does the replacement > > as well as the attachment - this way you keep all the 'magic' in one > > place. here is a link to the phpmailer docs: > > > > http://phpmailer.sourceforge.net/tutorial.html#3.3 > > > > good luck :-) > > > >> > >> Abdul-Wahid > > -- > Smarty General Mailing List (http://smarty.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

« previous php.smarty.general (#12192) next »