• Resolved lyfa

    (@lyfa)


    Hi,

    I’m having a problem where my customers are getting the transaction email not only when they get credit added but also when they use their credit for an order.

    I would much prefer to send an email only when they get credit added.

    Is there a way to disable the transaction email for debits and only have it for credits.

    I think it makes sense to have the two emails seperate anyway!

    Thanks in advance

    Lewys

    • This topic was modified 3 years, 2 months ago by lyfa.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Subrata Mal

    (@subratamal)

    @lyfa Please use bellow attached code in the theme function.php file to disable debit email notification.

    add_filter('woocommerce_email_enabled_new_wallet_transaction', 'woocommerce_email_enabled_new_wallet_transaction_callback', 10, 3);
    
    if(!function_exists('woocommerce_email_enabled_new_wallet_transaction_callback')){
        function woocommerce_email_enabled_new_wallet_transaction_callback($enabled, $object, $email){
            if('debit' === $email->type){
                $enabled = false;
            }
            return $enabled;
        }
    }
    Thread Starter lyfa

    (@lyfa)

    Wow thanks for getting back to me!, I’ll try it to see if it works now!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Transaction emails only for credit (or separated)’ is closed to new replies.