21278 Posts in 5728 Topics by 2599 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 990 Views |
-
Populate Data? How Works?

29 January 2010 at 2:06am
I wrote:
$templateData = array(
'WelcomeMessage' => $welcomeMsg, // Accessible in template via $WelcomeMessage
'VarFirstName' => $SignupFirst,
'VarEmail' => $SignupEmailAddress,
'VarPassword' => $SignupPwd,
'VarSurname' => $SignupSurn
);
$email->populateTemplate($templateData);and my SignUp.ss template is:
<h3>Hi, $VarFirstName $VarSurname.</h3>
<br/><p>$WelcomeMessage</p>
<ul>
<li><strong>Email:</strong>$VarEmail</li>
<li><strong>Password:</strong>$VarPassword</li>but my template vars on signup.ss are not populated. Only $WelcomeMessage. Why?
-
Re: Populate Data? How Works?

1 February 2010 at 9:59am
What about making sure the values are actually passed into $templateData?
$templateData = array(
'WelcomeMessage' => $welcomeMsg, // Accessible in template via $WelcomeMessage
'VarFirstName' => $SignupFirst,
'VarEmail' => $SignupEmailAddress,
'VarPassword' => $SignupPwd,
'VarSurname' => $SignupSurn
);var_dump($templateData['VarFirstName']); exit;
$email->populateTemplate($templateData);
Where are the $SignupFirst and friends coming from, can you show more code?
cheers,
mat -
Re: Populate Data? How Works?

4 February 2010 at 11:24pm
Thank you for your reply.
The code is:
function Invia_Email_Registrazione($data) {
$from="info@abc.zxx";
$to=$data['Email'];
$subject="Confirmed";
$body="";
$email = new Email($from, $to, $subject, $body);
$email->setTemplate('SignUp');
$SignupFirst=$data['FirstName'];
$SignupSurn=$data['Surname'];
$SignupEmailAddress=$data['Email'];
$SignupPwd=$data['Password'];
$welcomeMsg = ' Ti sei registrato il '.date('Y-m-d'.'!');$data coming from function SignupAction($data, $form) because I call $this->Invia_Email_Registrazione($data) into SignupAction.
Bye
-
Re: Populate Data? How Works?

7 February 2010 at 11:55pm Last edited: 8 February 2010 12:12am
Debug?
Have I to add ?debug=1 after url? ok.Tested: I've not any errors and I'don't see, with debug=1, where registration form call send email function and populate data...
And How Can I use some debug output into code?
-
Re: Populate Data? How Works?

8 February 2010 at 9:04am Last edited: 8 February 2010 9:04am
Just put the line
var_dump($variable_to_display); exit;
into the code somewhere and use the page as normal. var_dump will print out the content of the variable (object or whatever) and exit will kill the program just afterwards, so you will be able to see the output. See the code block in my first post.
mat
| 990 Views | ||
|
Page:
1
|
Go to Top |
