Forums

String length and e-mail template

nag 21 Oct, 2015
Hi,

I'd like to make a PHP condition in my email template but the string length is strange...
<?php
var_dump('atelier');
// string(7) "atelier" : OK

var_dump('{profil}');
// string(8) "atelier" : strange!

var_dump('{profil}' == 'atelier');
// bool(false)
?>

What can I do ?
GreyHead 21 Oct, 2015
Hi nag,

Sorry, I have no idea what your question is ;-(

What exactly are you trying to do?

Bob
nag 22 Oct, 2015
Sorry, my question wasn't clear enough.

Here's a test:
<?php
if ('{profil}' == 'atelier') {
  echo 'yes';
} else {
  echo 'no';
}
?>

This code displays "no". I want it to display "yes".
GreyHead 22 Oct, 2015
Answer
Hi nag,

The {profile} syntax won't work in PHP, please try
if ( $form->data['profile'] == 'atelier' ) {

Bob
nag 22 Oct, 2015
It works now. Thank you !
This topic is locked and no more replies can be posted.