Hello everyone,

this is what I posted on the forum already, without any reply, however, so I'd be glad if someone could answer it here, maybe.

On my university website, I would like every user of certain roles to be subscribed (using the subscription module) to certain content, based on taxonomy terms.

The users can opt out whenever they want to, but I want to subscribe them initially, at least, to these topics.

Has anyone got any idea how to do this, maybe with some php code?

Thanks a lot in advance,

Felix.

Comments

salvis’s picture

Version: 5.x-1.9 »
Category: support » feature

I would like to see this feature, too, but it's not a small task...

Note: no new development is done in the 1.x branch and the 2.x branch is still under development.

esadot’s picture

I second

felixsmile’s picture

Not a small task, indeed, but a very useful one =D

Maybe someone knows a workaround in the meantime, some code (mySQL or php) I could execute on my database to "manually" add the required users?

felixsmile’s picture

In the meantime, my workaround was to update the database manually (the table is called subscriptions) which worked fine, although it's quite a lot of work.

Have a nice day!

Felix.

salvis’s picture

Version: » 5.x-2.0-beta6
Status: Active » Fixed

You can now define sets for subscriptions for the authenticated user and for each role, and these will be assigned at user creation time.

felixsmile’s picture

That's cool. Thanks a lot!

For existing users (or if you have to make some changes), I suppose I will still have to use the "old" method (fiddling with the database), is that right?

Happy New Year,

Felix.

salvis’s picture

No, you can do them one by one at /user/NNN/subscriptions, but if you have to do many of them, you probably want to stay with the database...

Thanks, Happy New Year to you, too!

felixsmile’s picture

Sorry I wasn't clear, this is what I meant: for existing users in an existing role, I can't just subscribe all the existing users of a role to a new taxonomy term (for instance, when I create a new taxonomy term and would like some roles to be subscribed to that new term automatically).

Thanks for your answer, I'll stick with the database hacking then (haha, I'm not very good at MySql, so I always export the subscriptions and edit them with OOCalc and Notepad++ =D).

Felix.

salvis’s picture

Status: Closed (fixed) » Fixed

No, this doesn't currently work. It's a can of worms. What happens if you add/remove roles to users? What happens if you remove roles from the site? Is it legitimate to add subscriptions to a user (because you've added them to a role that the user has), even though that user has opted out of all originally assigned subscriptions (they don't want to receive email)? What happens if a user has opted out of a subscription and you give them a new role that has that same subscription and adds it again?

EDIT: See http://drupal.org/node/360198#comment-1207178 for one person's answers to these questions...

felixsmile’s picture

You're so right (unfortunately =D). I guessed that kind of problem would arise... I hadn't seen the whole extent of the problem though :)

Cheers,

Felix.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.