Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
In the to-field I can choose all website users. For a project I'm currently working on I need to send messages to (some) individual members of the group I'm subscribed to. Where do I start to try to develop this?
Comment | File | Size | Author |
---|---|---|---|
#6 | privatemsg_og.zip | 2.85 KB | HansKuiters |
Comments
Comment #1
ptmkenny CreditAttribution: ptmkenny commentedComment #2
jaxtheking CreditAttribution: jaxtheking commentedI had the same requirement. Actually, that's why I had never used the privatemsg module as I always needed to be able to exchange messages within group members only.
In our latest project, I really needed it, so I found possibly the easiest way of achieving this.
Place this function in your own custom module (and replace 'mymodule' with your module name) and clear cache/visit the modules page.
Note: it currently works only with standard the group type (node).
Comment #3
HansKuiters CreditAttribution: HansKuiters commentedThanks for this module, it works like a charm.
Comment #4
HansKuiters CreditAttribution: HansKuiters commentedI tweaked it a bit. It now checks for actually being group members available before altering the query. Otherwise the autocomplete throws an error.
Comment #5
Anonymous (not verified) CreditAttribution: Anonymous commentedJax and Capono, thank you. This works great. Would be nice if we could get it committed as part of private messages. I guess it would have to be a module option; if the user is using OG, to permit them to turn this on/off. I don't know how to do that but it sure would be cool!
It took me a lot of searching to find this so my following words are added simply to help some other developer to find it:
This custom hook will narrow the list of names in private message to only those within the groups (Organic groups - OG) you are part of. So if you use /message/new and enter a persons name all the site names are searchable. With this hook only those names contained in the organic groups you are part of are found, thus honoring the Organic groups structure.
Thanks again!
Comment #6
HansKuiters CreditAttribution: HansKuiters commentedWorks well with Privatemsg 7.x-2.x-dev. I attached a module for it. I don't have a D.O. dev-account so can't commit it.
Comment #7
HansKuiters CreditAttribution: HansKuiters commentedComment #8
CountPacMan CreditAttribution: CountPacMan commentedTested - works great. Thanks jaxtheking and capono!
Comment #9
surendramohan CreditAttribution: surendramohan as a volunteer commentedThanks @HansKuiters for the module :) It works great! Except that it also includes the sender username in the list of recipients. It would be appreciated if it is fixed! Thanks again!
Comment #10
pinueve CreditAttribution: pinueve commented+1 #6 your module just works great, thanks @HansKuiters for shearing it, +1#9, small fix that i think should be done.
Comment #11
SocialNicheGuru CreditAttribution: SocialNicheGuru commentedShould this be an add on to private message or should it get it's own home?
Comment #12
ivnish CreditAttribution: ivnish commented