Problems, need help? Have a tip or advice? Post it here.
5 posts Page 1 of 1
Hi

I'm wondering if I could use an if/else statement within a send_mail tag, in order to define to which emailaddress a message is send. (in my case the bcc address)

This is the code I would write to achieve this, but I get an error message.

Could you look into this if the code is wrong?
Or is there an other approach to achieve this?

Thanks!

Code: Select all
        <cms:send_mail from='sam.verdyck@gmail.com' to=frm_email <cms:if frm_afhandeling = "Te leveren">bcc='hello@samverdyck.be, sam@badboot.be' <cms:else /> bcc='hello@samverdyck.be,' </cms:if> subject='Uw bestelling bij Casa Di Batavia' debug='1'>

Hi,
Code: Select all
<cms:send_mail 
    from='sam.verdyck@gmail.com'
    to=frm_email
    bcc="<cms:if frm_afhandeling='Te leveren'>hello@samverdyck.be, sam@badboot.be<cms:else />hello@samverdyck.be</cms:if>"
    subject='Uw bestelling bij Casa Di Batavia'
    debug='1'
>

Alternatively, you might find it easier to use the if/else as a separate block like this -
Code: Select all
<cms:if frm_afhandeling = "Te leveren">
    <cms:set my_bcc='hello@samverdyck.be, sam@badboot.be' />
<cms:else />
    <cms:set my_bcc='hello@samverdyck.be' />
</cms:if>

<cms:send_mail
    from='sam.verdyck@gmail.com'
    to=frm_email
    bcc=my_bcc
    subject='Uw bestelling bij Casa Di Batavia'
    debug='1'
>

Hope this helps.
Thanks again!

Got another question regarding the checkout through email.
I found some info about the empty_cart tag, to clear the cart when checking out.

Using it with pp_payment_gateway brings me to a PayPal page, which I don't need.

Could you give me a starting point on how to implement a empty cart function on my code below?

Code: Select all
          <cms:form method="post" anchor='1'>
            <cms:get_flash 'success_flash_msg' />

            <cms:if k_success >
                               
<cms:send_mail from='bestellingen@casadibatavia.com' to=frm_email bcc="<cms:if frm_afhandeling='Te leveren'>hello@samverdyck.be, sam@badboot.be<cms:else />hello@samverdyck.be</cms:if>" subject='Uw bestelling bij Casa Di Batavia' debug='1'>
<p>Bedankt voor uw bestelling, <cms:show frm_name />!</p

<p>Uw bestelling is bevestigd en wordt verwerkt, hieronder vindt u een overzicht.</p>

<p><i>Met smakelijke groeten</i></p>

<p><i>Het Casa Di Batavia Team</i></p>
<br>
<br>
<p><strong>Overzicht bestelling:</strong></p>
<p>Naam: <cms:show frm_name />
<br>Emailadres: <cms:show frm_email />
<br>Telefoon/GSM: <cms:show frm_tel /></p>
<p><cms:pp_cart_items>
<span style="font-weight:bold;"><cms:show title />: <cms:show quantity /> <cms:show eenheid_af /> - € <cms:number_format line_total /></span>
<cms:pp_selected_options startcount='1'>
<b><cms:show option_name /></b>: <cms:show option_value /><br />
</cms:pp_selected_options>
</cms:pp_cart_items></p>
<p>Totaal te betalen bedrag bij ophaling/levering: € <cms:number_format "<cms:pp_total />" />
<br>Bestelling: <cms:show frm_afhandeling /> op <cms:show frm_my_datetime /></p>

<p>Leveradres:
<br><cms:show frm_straat />
<br><cms:show frm_postcode />
<br><cms:show frm_plaats /></p>

<p>Leveringswijze: <cms:show frm_koud_warm /></p>

<p>Opmerkingen:
<br><cms:show frm_opmerkingen /></p>   

</cms:send_mail>
                                   
               <!--  <div class="good">
                  <cms:set_flash name='success_flash_msg' value="<p class='success'>Bedankt voor uw bestelling! U ontvangt dadelijk een bevestigingsmail.</p>" />
                </div> -->
                <cms:redirect 'good.php' />
            </cms:if>
            <cms:if k_error >
              <div class="error">
                  <ul>
                  <cms:each k_error >
                      <li><cms:show item /></li>
                  </cms:each>
                  </ul>
              </div>
            </cms:if>
I found some info about the empty_cart tag, to clear the cart when checking out.
Using it with pp_payment_gateway brings me to a PayPal page, which I don't need.

Please use <cms:pp_empty_cart /> instead.

Hope this helps.
Thanks! Overlooked that option.
5 posts Page 1 of 1