Currently if enabled, emails got sent when the order is created.
This is problematic when using payment gateways, as at the moment of order creation (and thus email sending) the payment process is not finished, so we don't know if the payment was successful or not.
Most likely we want to send a different email (or no email at all) when payment is not successful, than what we send normally.
Also many payment providers wants us to show the technical details of the payment transaction in the order confirmation email, which is now impossible, due to these reasons.
If the email sending (which is currenlty in Lovata\OrdersShopaholic\Classes\Event\Order\OrderModelHandler::sendUserEmailAfterCreating() ) would be encapsulated in some helper we can call after the payment process is complete, then we would have more control over it, and could add the transaction data, or decide not to send email at all when the payment was failed (depending on what the regulation rules are, etc).
Currently if enabled, emails got sent when the order is created. This is problematic when using payment gateways, as at the moment of order creation (and thus email sending) the payment process is not finished, so we don't know if the payment was successful or not. Most likely we want to send a different email (or no email at all) when payment is not successful, than what we send normally.
Also many payment providers wants us to show the technical details of the payment transaction in the order confirmation email, which is now impossible, due to these reasons.
If the email sending (which is currenlty in Lovata\OrdersShopaholic\Classes\Event\Order\OrderModelHandler::sendUserEmailAfterCreating() ) would be encapsulated in some helper we can call after the payment process is complete, then we would have more control over it, and could add the transaction data, or decide not to send email at all when the payment was failed (depending on what the regulation rules are, etc).