Jump to content

Custom alert email for leasing payment module


Recommended Posts

Hello,
I'm new in Prestashop (working with Opencart) so I'm sorry if my question is a bit imprecise.
My friend ask to create payment module and I write it.
I wrote a new payment module that communicates via API with the leasing company. The module works fine, no questions.
Question about alert email. I need to create a new email mail template with additional information about the leasing order and send this email after the order is confirmed. 

I have tried to add additional info to order_conf  like this:

$mailVars = [
                '{sb_payment_orderNr}' => $order_query['orderNr'] ? $order_query['orderNr'] : '',
                '{sb_payment_status}'  => nl2br($new_status_id ?: ''),
            ];

            if ($cart->OrderExists() == false)) {
                $this->module->validateOrder($cart_id, $new_status_id, $total, $this->module->displayName, null, $mailVars, (int)$cart->id_currency, false, $customer->secure_key);
            }

and modifying order_conf template...

it  works, but when is use another payment method showing just this vars {sb_payment_orderNr} {sb_payment_status} which should be hidden.

So the best way I think to create new alert email with his own template...

Can you put me on the way how to do this? 
The best way add that all to payment module installation pack without editing core files.

Prestashop 1.7.8.10

Edited by aaggaa (see edit history)
Link to comment
Share on other sites

  • 3 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...