Hi, i used code which i find on this forum for remove empty fields in email :
My template is - example : ( i change it on tab Pages and nex tab Template : https://prnt.sc/qy5eh1 )
But when this filed is not empty i dont see it in email too. Can you help me fix it please ? thanks
<?php if(!empty($form->data["field_name"])): ?>{field_name}<?php endif; ?>
My template is - example : ( i change it on tab Pages and nex tab Template : https://prnt.sc/qy5eh1 )
<?php if(!empty($form->data["titul"])): ?>
<tr>
<td width="100%">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr style="background-color:#fafafb">
<td style="padding:7px;"><strong>Titul</strong></td>
</tr>
<tr>
<td style="padding:7px;">{data:titul}</td>
</tr>
</table>
</td>
</tr>
<?php endif; ?>
But when this filed is not empty i dont see it in email too. Can you help me fix it please ? thanks
$this->data('field_name') not $form->data['fieldname']
Thanks .
I have one next question .
i have in template if conditionals example :
<?php if($this->data["sluzba"] = "servis_pravidelny"): ?>
...
...
...
<?php endif; ?>
<?php if($this->data["sluzba"] = "pneuservis"): ?>
...
...
...
<?php endif; ?>
<?php if($this->data["sluzba"] = "nahradne_vozidlo"): ?>
...
...
...
<?php endif; ?>
but in email i see last value only . how i can fix it thanks .
I have one next question .
i have in template if conditionals example :
<?php if($this->data["sluzba"] = "servis_pravidelny"): ?>
...
...
...
<?php endif; ?>
<?php if($this->data["sluzba"] = "pneuservis"): ?>
...
...
...
<?php endif; ?>
<?php if($this->data["sluzba"] = "nahradne_vozidlo"): ?>
...
...
...
<?php endif; ?>
but in email i see last value only . how i can fix it thanks .
== not =
Thanks healyhatman .
Can I show in Email not value but show value from frontend for dropdown .
Example dropdown:
material=Materiál
pneuservis=Pneuservis
nahradne_vozidlo=Náhradné vozidlo
I want show in email Náhradné vozidlo , not nahradne_vozidlo.
Can I do it ? thanks
Can I show in Email not value but show value from frontend for dropdown .
Example dropdown:
material=Materiál
pneuservis=Pneuservis
nahradne_vozidlo=Náhradné vozidlo
I want show in email Náhradné vozidlo , not nahradne_vozidlo.
Can I do it ? thanks
No. You have to do it again - like
$values = [ ''material' => 'Materiaaaal', 'pneuservis' => 'Pneuservis', etc etc ];
echo $values[$this->data('field_name')] ?? 'Invalid selection';
This topic is locked and no more replies can be posted.