2

I've used EE for a while now but I'm new to creating extensions or modules. I want to add a functionality where a bunch of email addresses stored in a database get notified when an entry is submitted in a particular channel. I've scanned docs and other sources and determined a module was my best bet.

I've started my module following the official tutorial. I've also found pkg.io which is very useful to kickstart module development.

My issue is that I can't figure out how to use hooks the way I want to. It seems that the entry_submission_end hook is the one I'm looking for, but I'm missing where $this->extensions->call('entry_submission_end', $this->entry_id, $this->meta, $this->data); should be included.

I've searched for tutorial on modules or extensions development using hooks but didn't not find any reliable or clear source that could help me. Thanks!

2 Answers 2

2

If you look at Activating & Updating in the Extensions documentation, you'll see in the code example that the data passed to the Insert query contains a reference to an ExpressionEngine hook. That database entry will enable your extension to be called when that hook is triggered.

All available hooks are documented here.

2

Yes, it can be a bit tricky to get into it at first. What you're looking for are the Extension docs: http://ellislab.com/expressionengine/user-guide/development/extensions.html

An extension can be included alongside a module.

The code that you posted is the actual code called within EE when loading any extensions attached to that hook. Thus all the parameters shown (after the first) are what you'll have access to within your extension.

4
  • I thought I'd go the module + extension way since I need a CP interface. Where I get confused is, how or where do you attach extensions to hooks? Commented Mar 7, 2013 at 14:21
  • @RémiBreton, just wondering why you gave the answer to Mark when I answered it first?
    – Paul
    Commented Mar 7, 2013 at 18:33
  • He referred to the section in the documentation I needed. I didn't understand that methods and hooks were paired in a database table and his answer pointed me right at it. Commented Mar 7, 2013 at 18:38
  • @RémiBreton, I see, yes he pointed you to two places in the page I linked to. To understand how to develop an extension properly you'll need to read the whole page I sent.
    – Paul
    Commented Mar 7, 2013 at 22:56

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.