do_action won’t work in ajax callback

I want to perform some actions when ajax tasks done successfully. For instance, if the item added to the cart, I want to send an email. Also may perform a few more actions.

Setting up do_action('prefix_item_added_to_cart', $args); doesn’t recognized and so add_action doesn’t perform a task, in my case sending email.

If I write code procedural code to send an email, that works fine but using do_action.