I need to create my custom subscription but I don't know how to use hook_notifications in version 7
Also I need to alter the query of notification to add one more condition before sending the notifications

is there anybody who can help please?

Comments

bsandor’s picture

I'm in the same boat.

in D6 we had hook_notifications(). By implementing it and using switch for $op in case 'query' you had the option for a $query[]['join'].
This was my alteration in D6.

I'd like to do the same in D7. What's the way for giving alteration or my D6 version 'join' to wht is sent to messaging?

Anyone any idea please!?

Thanks

bsandor’s picture

Title: hook_notifications and notifications_query_alter » hook_notifications, notifications_query_alter, query join

changed title of this issue

bsandor’s picture

This article might help. I don't know how yet.
http://drupal.org/node/1796702

bsandor’s picture

Title: hook_notifications, notifications_query_alter, query join » Altering Query in Notifications 7.x (hook_notifications, notifications_query_alter, query join)
seddonym’s picture

Hi, yes Notifications 7.x is woefully underdocumented and really different from the previous version.

It's been a while since I worked with it, but I suspect the best way to achieve what you both need to do is to define either a new subscription type, or a new event, depending on what you want to customize. The article here should give you a sense of how the various parts fit together. https://drupal.org/node/1710410

That's only a starting point but hopefully it should give you a sense of the key concepts.

After that, your best bet is to look at the source code directly.

bsandor’s picture

That post currently says nothing about this topic