In the 4.6 version of og, mail is automatically sent when a user is subscribed. There is currently no option to disable this, even if your application makes this undesireable.
This patch factors out the actual subscription and unsubscription code, and adds two functions to the API:
function og_create_subscription($gid, $uid);
function og_delete_subscription($gid, $uid);
The patched version of the module calls these functions in og_approve, og_deny, and og_unsubscribe.
The patch does not add any UI at all; it's designed to allow module developers to subscribe and unsubscribe users without getting mail sent as a side effect.
Comments
Comment #1
moshe weitzman commentedlooks good ... any chance you provide a patch for HEAD? 4.6 is not getting any new features or refactoring anymore.
Comment #2
moshe weitzman commentedComment #3
Torenware commentedNo problem, although I don't have a working install of HEAD right now. I'll pull the head version and carefully do the patch, and will pass you both the patch and the modified copy of og.module.
I can't guarantee it will work because I won't be able to test it easily. But you can just drop in the copy and see if it "behaves".
Comment #4
Torenware commentedHere's a version based upon the "cvs" version, which is hopefully close to what you mean by "HEAD".
The code that's affected by my patch actually hasn't changed between 4.6.0 and CVS, which made my life easier; the harder part was to find the differences between vanilla 4.6.0 and cvs. But I'd guess that my merge should run "out of the box".
I'm enclosing both the merged file and the patch, since if the merged version causes any kind of trouble, the patch is unlikely to be any good either.
Comment #5
Torenware commentedHere's the same code, as a patch off the CVS version.
Comment #6
killes@www.drop.org commentedI've updated the patch to obey Drupal code style conventions.
I am not completely sure about the usefullness of the watchdog messages, So I've taken them out. "user 23 added to group 42" isn't a usefull message after all.
Moshe: I think I would add the proposed hooks into those new functions.
Comment #7
killes@www.drop.org commentedok, the last patch didn't take into account all possible simplifications. thi sone does and will be committed swith permission.
Comment #8
moshe weitzman commentedthis one was committed a long time ago
Comment #9
(not verified) commented