Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
HI,
I use the Rules module and the Organic Group module.
I want to notificate by email all members of a group when a new post is published in the group. Is it actually possible to make that ? Or not ?
It would be an alternative to the existing Action Rule : "Send email to a Role".
Thanks for your help !
Comment | File | Size | Author |
---|---|---|---|
#16 | drupal-example.jpg | 78.98 KB | paultrotter50 |
Comments
Comment #1
mitchell CreditAttribution: mitchell commentedOrganic Groups already has a condition for 'Content is a group post' but there isn't yet an action for sending an email to group members. Without that action, you could use views and a custom php action like what's in #371728: Load Multiple Nodes to perform actions on them, but that isn't as pretty a solution.
Comment #2
vstmusic CreditAttribution: vstmusic commentedIt's a little tricky.
Is it possible to implement this feature ?
Comment #3
vstmusic CreditAttribution: vstmusic commentedI must use a php code to select the emails of members of an organic group, with view module ?
I can't make that alone. can you help me ?
Comment #4
brisath CreditAttribution: brisath commentedSubscribing. I would like a feature for using Rules to send tokenized emails to each group member (from the group where a post was placed).
Comment #5
amitaibuLooping over a list can only be done in Rules (i.e. for Drupal 7). You will need custom code to achieve this in D6.
Comment #6
mitchell CreditAttribution: mitchell commentedSee: http://www.sthlmconnection.se/tips-and-tweaks/rules-based-notifications-...
Comment #7
vstmusic CreditAttribution: vstmusic commentedthanks for this link. I have tryed this tutorial but it actually sends blank email. I don't understand why.
Comment #8
bryancasler CreditAttribution: bryancasler commentedsubscribe
Comment #9
vstmusic CreditAttribution: vstmusic commentedNow it works ! The author of the code have edited his code !
Very useful !
Comment #10
brisath CreditAttribution: brisath commentedGreat details in that description in #6. However, I'm hesitant to try the custom module method for fear of minor problems like #7 and updates that might make it incompatible. For me, this feature would be useful it if was part of the OG package.
Comment #11
vstmusic CreditAttribution: vstmusic commentedI confirm it's a very useful module ! I use it since 1 month an NO PROBLEM !
Comment #12
jamsilver CreditAttribution: jamsilver commentedFor those of us still searching for something simple but effective, I just stumbled across http://drupal.org/project/og_email_blast which just does what everyone wants =)
Comment #13
flaviovs CreditAttribution: flaviovs commentedNot saying that the aforementioned module isn't useful, but one should notice that it is D7 only, and this post is (so far) about D6.
Comment #14
Yonik CreditAttribution: Yonik commentedI've the same problem but I've D7. Any idea?
Thanks.
Comment #15
flaviovs CreditAttribution: flaviovs commented@Yonik, for D7, see amitaibu's comment #5.
Basically, Rules + Views may be used to implement this.
E.g. create a view that list users subscribed to a group (do not forget to check for active membership, unblocked account, etc.), and filter the view by group (node) ID using a contextual filter. Next, create a rule that react to a new post on a group. Then, using Rules Bonus Pack or View Rules, loop over your view (group nid being passed as argument) to send emails or maybe do other fancy things with each member.
Notice that this may work well only for small groups, but you may encounter performance and/or memory problems with large groups.
Comment #16
paultrotter50 CreditAttribution: paultrotter50 commentedFor anyone who is looking here for the Drupal 7 method this is quite straightforward with rules and a loop. See screenshot
Comment #17
vstmusic CreditAttribution: vstmusic commentedHow to select the ACTIVE users of a group, with the paultrotter50 method ?
Thanks !
Comment #18
carsato CreditAttribution: carsato commentedHello.
I managed to solve it using "og_is_member()" using php in the "to:" field.
I load a members of the group.
I load the node of the group ($club)
I add an action (send email)
In the "to:" field, with php I set:
Comment #19
vstmusic CreditAttribution: vstmusic commentedUP : How to select the ACTIVE users of a group, with the paultrotter50 method ?
With this method, inactive users receive email notifications. It's a problem.
Comment #20
simon_j_nichols CreditAttribution: simon_j_nichols commentedPauls method should work, the interface for
og_is_member
isog_is_member($group_type, $gid, $entity_type = 'user', $entity = NULL, $states = array(OG_STATE_ACTIVE))
so only active members should be selected by default. I think the embedded php carsato used is considered bad form (but hey if it works!!! and you avoid using a loop to sometimes send identical mail to each member individually). I actually built a new action to get all members and mail them together by populating the to: field with a list, to do essentially the same as carsato but within the rules framework, so if you have a little php experience that's another option.
Comment #21
vstmusic CreditAttribution: vstmusic commentedSorry, by using the terms "the active users of a group", I mean the users who are not blocked in the user/edit form. In fact, with the paultrotter50 solution (#16), the blocked users receive notifications of the OG groups in which they have subscribed. Do you understand ? (sorry for my bad english...)