I am using Magento 2x and trying to integrate a Payment Gateway called Telr.

The issue I am facing with it is, an Order Confirmation Email is being sent the moment the customer is being redirected to Payment Gateway irrespective of the Order being Failed, Cancelled, Successful etc.

I reported the same to the Payment Gateway Company (Telr). But they said this is a flaw from Magento itself.

Then I showed them that they were wrong by using PayPal Express Checkout & Braintree Payment. Both the payment gateway worked fine, as expected, i.e, Order Confirmation Email was only being sent once the Order was SUCCESSFUL, and not immediately after being redirected to Paypayl, as it's happening with Telr. I demoed the same to them with the help of a Test Transaction via screencast.

They are still in DENIAL and saying that they cannot use Paypal's workflow as it will cause a MAJOR SECURITY LOOPHOLE. Please check attached image for screenshot of their response Email.

It would be GREAT HELP, if anybody could confirm whether what Telr is saying is TRUE OR NOT. AFAIK this isn't true.

enter image description here


  • Hi, Im facing the same issue did you find the solution, order also created without payment Nov 22, 2019 at 10:21
  • @PurnendarGattu There seem to be no solution other than disabling the Order Confirmation Email when using payment gateways such as CC Avenue, Telr, PayTabs etc. But when I tested with Paypal & Braintree it worked fine. No Order confirmation Email was being sent for any unsuccessful transaction/order.
    – eVagabond
    Nov 22, 2019 at 11:02
  • yes, but by disabling the email will stops only mail confirmation but here order also created before the payment even it failed transaction or customer canceled to pay Nov 22, 2019 at 12:29

1 Answer 1


You have 2 options here either do it using Magento settings or do it in your custom module code :

via admin settings:

You can choose to send order email upon invoice creation to do that :

Admin -> Stores -> Configuration -> Sales -> Sales Email -> Order -> Enabled set to NO

and then go to:

Admin -> Stores -> Configuration -> Sales -> Sales Email -> Invoice -> Enabled set to YES

Code changes in your module:

In your payment method model call setCanSendNewEmailFlag() and set it to false.


And once user redirected to your controller ( where you will be getting order status i.e success / captured ,failure ) set this method to TRUE

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.