Order creation e-mail only with bank transfer

  • Posts: 130
  • Thank you received: 6
  • Hikashop Business
3 weeks 3 days ago #310341

-- HikaShop version -- : 4.2.1
-- Joomla version -- : 3.9.11
-- PHP version -- : 7.3.x
-- Browser(s) name and version -- : Chrome

Hi,

I only want to sent an order created e-mail when the bank transfer is used. I found this post: www.hikashop.com/forum/orders-management...-for-bank-trans.html

I created the following code:

<?php if($data->order_payment_method !== 'bank_transfer') $data->customer->user_email = ''; ?>
This code has to go on top in the order created e-mail template.

Is this still a valid way to sent the e-mail only on bank transfer skipping all others? Or is there an other smart way?

Regards!

Please Log in or Create an account to join the conversation.

  • Posts: 66889
  • Thank you received: 9887
  • MODERATOR
3 weeks 2 days ago #310346

Hi,

Instead of $data->customer->user_email = ''; you should use $mail->published = false; in your code.

Please Log in or Create an account to join the conversation.

  • Posts: 130
  • Thank you received: 6
  • Hikashop Business
3 weeks 2 days ago #310376

Just to be complete. Dit some tweaking af found a little error. The correct code to block the mail is:

<?php if($data->order_payment_method !== 'banktransfer') $mail->published = false; ?>

Just for everyone who needs this kind of feature!

Please Log in or Create an account to join the conversation.

Time to create page: 0.057 seconds
Powered by Kunena Forum