i see the problem.
The store cart details behavior is redirecting to the success page before the email is being sent.
change line 285:
$WA_redirectURL = "checkout_success.php";
to:
$WA_redirectURL = "";
then change line 343:
$GoToPage = "";
to:
$GoToPage = "checkout_success.php";