[SOLVED] PHP / HTML E-Mail Template Question

Status
Not open for further replies.

wuschel_lux

Member
Hi all,
I struggle with a custom e-mail template. I started this to have a bit CSS included.

I have a part where I ask in the form if parent address is same as kids address and depending on this vaiables value I want to show a text: same ass kid or if different show the parents address.

Here en extract of the code in the php file, possible values for {vaa_camp_reg___same_address_raw} can be: diff_addr | same_addr

HTML:
<p>
        Your registration details:
        <h2>MAIN CONTACT PERSON</h2>
        <ul>
            <li><b>{vaa_camp_reg___first_name_contact} {vaa_camp_reg___last_name_contact} ({vaa_camp_reg___relation_contact})</b></li>
            <li>E-Mail:                <b>{vaa_camp_reg___email_contact}</b></li>
            <li>Phone:                <b>{vaa_camp_reg___phone_contact} / {vaa_camp_reg___phone_emc_contact}</b></li>
            <?php
            $myVarRaw = '{vaa_camp_reg___same_address_raw}';
            if( strpos($myVarRaw, 'same') !== false ){
                echo '<li>Address:            <b>{vaa_camp_reg___same_address}</b></li>';
            } else {
                echo '<li>Address:            <b>    {vaa_camp_reg___address_contact}<br>
                                                {vaa_camp_reg___zip_contact} {vaa_camp_reg___city_contact}<br>
                                                {vaa_camp_reg___country_contact}
                                            </b>
                    </li>';
            }
            echo '<li>myVarRaw = '.$myVarRaw.'</li>';
            ?>  
        </ul>

But when I test both options, the else part is never executed.
Do I have something written not correctly. I am happy for all suggestions.

BR
 
I think in php templates you can't use {} placeholders in the code parts (they are replaced later).
See the example files for how to get the data, something like
$this->data['vaa_camp_reg___same_address_raw']
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top