Hi,
i try to insert php code in the email as i was doing with cfv5.
Example check existing value :
<?php if(!empty($form->data["address"])): ?>
Adresse : {address} <br/>
<?php endif; ?>
But in cfv6 php in not executed.
Any help
Regards
i try to insert php code in the email as i was doing with cfv5.
Example check existing value :
<?php if(!empty($form->data["address"])): ?>
Adresse : {address} <br/>
<?php endif; ?>
But in cfv6 php in not executed.
Any help
Regards
I have found a solution. I hope it is the right method.
I creat a logic php event above email event called myphp :
and in email event
i call it with {var:myphp}
Seems correct
Regards
I creat a logic php event above email event called myphp :
if($this->data["myfield"] =='myvalue'): $hop='my text';
else : $hop='my other text';
endif;
return $hop;
and in email event
i call it with {var:myphp}
Seems correct
Regards
Hi Juan,
Correct!
Best regards,
Max
Correct!
Best regards,
Max
Hi,
ok that works but if i have 100fields, i have to creat 100 logic php even to check if the var is empty?
Maybe another easy method?
Regards
ok that works but if i have 100fields, i have to creat 100 logic php even to check if the var is empty?
Maybe another easy method?
Regards
Hi Juan,
There is a way, by passing dynamic parameters to the php function, define the PHP function before the email like this:
Then in your email:
And the next update should have a new feature which can provide an easier solution.
Best regards,
Max
There is a way, by passing dynamic parameters to the php function, define the PHP function before the email like this:
if($this->data($this->get("pname"))){
echo $this->get("plabel");
}
Then in your email:
{fn:myphp$pname=field1&plabel=field1}
{fn:myphp$pname=field2&plabel=field2}
And the next update should have a new feature which can provide an easier solution.
Best regards,
Max
This topic is locked and no more replies can be posted.