0

Hello I have created one event "post.order.add" but it is not triggered. in admin\controller\extension\module\my_api.php

public function install() {
      $this->model_extension_event->addEvent('myapi', 'post.order.add', 'extension/module/my_api/my_call_api');
    }

I have created function my_call_api in catalog\controller\extension\module\my_api.php and I am sending mail.

public function my_call_api($order_id)
    {
        $admin_mail = $this->config->get('config_email');

        mail($admin_mail, "Add Order post id - catlog", $order_id);
    }

but it will not triggered even and i am not getting any mail. I got order confirmation mail but not this event mail. anything wrong with my code.

DigitCart
  • 2,980
  • 2
  • 18
  • 28
Pranav Gandhi
  • 199
  • 1
  • 1
  • 8

1 Answers1

0

you need to load $this->load->model('extension/event'); inside the install method

Alexandru R
  • 8,560
  • 16
  • 64
  • 98