2013-02-09, 03:01 PM
Due to this issue in myALerts, I'm looking at using the PM handler's "datahandler_pm_insert" hook instead of "private_do_send_end" as I currently am.
The problem is that the datahandler hook is ran before the PM is actually inserted, meaning the PM ID is not set. There are three possible ways around this I can see:
Just looking to see if anybody might have any other ideas or past experience using the datahandler that I can call on to make life easier before diving into this.
Thanks in advance!
The problem is that the datahandler hook is ran before the PM is actually inserted, meaning the PM ID is not set. There are three possible ways around this I can see:
- Grab the highest ID from the private messages table and add 1 - kind of dirty and not really reliable if lots of PMs are getting sent often possibly.
- Use PluginLibrary to edit the PM handler to add a new hook after the PM is inserted.
- Use multiple hooks in all locations that PMs are sent rather than 1 single one - definitely not clean.
Just looking to see if anybody might have any other ideas or past experience using the datahandler that I can call on to make life easier before diving into this.
Thanks in advance!