On 07-12-2009 at 14:09:19 Anton Andriyevskyy <x.meg...@gmail.com> wrote:

Can you please give me an advice about PHPTAL usage in loop for mail sending?

$template = new PHPTAL('email_template.xhtml');

$template->title = 'The same for all recipients';
$template->name = 'Different for each recipient';

$emailBody = $template->execute();

My questions:

1. Now to generate next email with different name, must I set both title and name, or name only?

name only.

2. If it's not resetting after execute(), then do we have a method to reset it?

There's no method for it. You have to create new instance of PHPTAL.


Alternatively you can use clone:

$fresh_copy_of_phptal = new PHPTAL('template...');

$temp_phptal = clone $fresh_copy_of_phptal;

...

$temp_phptal = clone $fresh_copy_of_phptal;

...


(clone creates duplicate PHPTAL object that has copy of all settings and variables)

--
regards, Kornel

_______________________________________________
PHPTAL mailing list
PHPTAL@lists.motion-twin.com
http://lists.motion-twin.com/mailman/listinfo/phptal

Reply via email to