wp mail – wp_mail function not working in if else condition

Question

I am using wp_mail function to send mail if condition is match.

Here is my code:

if($results != NULL){
        //echo $step_complete;
    if($step_complete==1){
        wp_mail('test@mail.com', 'First Step', 'First Step Complete');          
    }
    else if($step_complete==2){
        wp_mail('test@mail.com', 'Second Step', 'Second Step Complete');                
    }
}

If step_complete 1 is matched it works but if step_complete 2 is found wp_mail not works.

Is there any bug in my code.

0
Sabbir 1 month 2021-06-21T01:28:30-05:00 0 Answers 0 views 0

Leave an answer

Browse
Browse