API documentation
gustav - November 22, 2007 - 21:30
| Project: | Subscriptions |
| Version: | 6.x-1.x-dev |
| Component: | Documentation |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | duplicate |
Jump to:
Description
I believe that recently I saw some documentation somewhere about the API functions that allow other modules to hook into the subscriptions module. Now I can't find it any more. Does anyone know where that documentation is or did I just dream about it?
Also, will the current rewrite of the module lead to a change to the API?

#1
Yes! chx has promised to supply an upgrade path, but other than that, there won't be any backward compatibility.
I'm not aware of any such documentation -- if it exists, it would apply to 1.x, not to 2.x.
(Don't try the current 2.x-dev — it's a dead end.)
#2
Thank you very much for that very fast response.
I now know why I was under the wrong impression that I had seen such an API documentation: I was thinking of the privatemsg module which does have an API.txt.
So now this is a question for chx: what will the API for the new subscription module be? In particular, I want to allow users to subscribe to organic groups (rather than using the separate subscription mechanism provided by organic groups which is not nearly as good and lacks crucial features).
#3
Ok, flipping back to 2.x.
You've already participated in http://drupal.org/node/187186 thread about rewriting 2.x from scratch. #4 has a link to the repository where we're working on it. Be warned that many things are still missing or buggy.
If chx' answer doesn't come quickly enough, then take a look at those files — they may give you an idea on how to write a subscriptions_og.module and hook into Subscriptions 2.x.
#4
The new Subscriptions 2.0 BETA-1 is available from the link on http://drupal.org/project/subscriptions, but do heed the warnings!
subscriptions_taxonomy.module should give you a good idea of what it takes to write a plug-in module.
#5
#6
I find it really difficult to figure out the API myself. I have looked at the subscriptions_taxonomy module and I can see various hook functions (subscriptions, node_options,...) but it is really very hard to find out what their purpose, their arguments and their expected return values are. It would be really very helpful to have this information.
#7
I agree, but we don't have anything but the code.
Lucky for me, you directed this at chx in #2...
:-)
#8
Yes, as the author of the code chx is best placed to write the documentation.
chx, will you be able to do that?
Aside: how do I assign this issue to chx? The "Assigned" drop-down menu only shows my name and 'Unassigned'.
#9
You can't. Assigning works only to yourself in order to signal that you intend to work on an issue.
#10
A good place to put this API documentation is as a child page of http://drupal.org/node/50377
#11
We would like to sponsor the documentation. If there is any interest in this, please let me know via my contact page.
#12
We also are interested in using the subscriptions module along with Organic Groups...
The only reason we are using OG though is to break up the node access table...
I.E. to allow people to subscribe to a taxonomy term, and only get notifications if the node meets both the criteria of...
1. The user belongs to the group the node was posted in, and
2. The user is subscribed to the term chosen by the creater of the node...
We've been having a very tough time with node access issues in doing so...
Is this along the lines of what you are seeking?
We would also be willing to sponsor/invest in this...
Our site was supposed to go live earlier this week, and we're getting desperate.
Daryl
#13
develCuy is now working on this in issue http://drupal.org/node/225648