17488 Posts in 4473 Topics by 1978 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1332 Views |
-
Email->populateTemplate() with multiple objects

28 October 2007 at 10:10pm
How can I do Email->populateTemplate() with multiple objects?
In the docu http://doc.silverstripe.com/assets/classes/default/Email_Template.html#populateTemplate
it says we can call it multiple times, but how does the template discern different variables?Suppose I have
$mail->populateTemplate($pageAuthor);
$mail->populateTemplate($comment);where both $pageAuthor and $comment have a $Username variable.
How can I let the emailtemplate know when to use what?
I suppose <% control %> wouldn't work? -
Re: Email->populateTemplate() with multiple objects

28 October 2007 at 11:31pm
A possible solution: just collect the vars you want in a new Array with different names and populate the template with that array.
| 1332 Views | ||
|
Page:
1
|
Go to Top |

