I am Sitting on a patch which I need to incorporate that addresses this exact issue (I think). I will try and do it tonight or tomorrow morning. I am delinquent on getting this done, a lot of other issues have taken priority.
Thread Starter
jeezy
(@traup)
@mike – very good sir. I look forward to the patch. Excellent plugin btw.
Now that it is morning and I am a little more focused, I am re-reading this thread. I am not sure the plugin you’re using is the same as the other plugin I have a patch for. Can you take a look at this thread and let me know if they’re the same plugin?
Thread Starter
jeezy
(@traup)
It is not the same plugin. User Groups doesn’t provide any security or access restriction capabilities. The plugin I am using is http://wordpress.org/plugins/user-access-manager/
Ok, I will have to take look at that. Work is crazy busy right now so it may be a few days before I can look at this other plugin and see if I have any ideas.
Thread Starter
jeezy
(@traup)
UAM creates two tables, one to hold the group info and then a relational table for the user id and group id. I don’t think it would be to hard to implement a solution to query user email addresses using this data. But I’m not sure about the email-users plugin and how to go about incorporating that.
I would give this a shot at implementing but I don’t want to not miss out on future updates.
The best way to do this is probably to create a separate plugin that creates a bridge between the two plugins. That way you don’t miss out on updates to either plugin by forking them. That is what I recommend for people who want to make use of the User Meta filtering functionality that Email Users supports. It has some hooks to facilitate doing it and that is probably what I would look at first to link it to the other plugin.
Thread Starter
jeezy
(@traup)
Thanks Mike, I think I will go this route with using my functions.php file. Your filter is using user meta data but the group plugin has it’s own separate table. I don’t see how this will work using meta data as a user can have multiple group relationships.
If I was to write my own functions that return an array of email address from a desired group, how would I push that array into the email_users plugin for email distribution?
Thread Starter
jeezy
(@traup)
I created a plugin with a separate form with a drop down list of UAM groups along with a subject/message. I then passed that collected data through a function that generates an array of emails from that selected group to the Email Users plugin function called mailusers_send_mail().
Everything seems to be working.
If you want to send it to me (use my WordPress.org username at gmail dot com) I will look at including it in the next update. There are a number of similar “User Group” plugins so making some optional functionality for sites that have them installed would be useful.
Thread Starter
jeezy
(@traup)
It’s on the way. Take it as a proof of concept plugin, not too much extra flare or validation built into it.
I have added an integration of UAM to Email-Users. If you’d like to check it out, you can try it in the v4.5.0-beta release I posed on my web site today.
Hmm – works when I click on it. It is the top post currently on michaelwalsh.org.
Thread Starter
jeezy
(@traup)
I installed the plugin, deactivated the one I created, cleared the cache and getting a fatal error: Call to undefined function mailusers_get_recipients_from_terms() line 179.
I am able to see my UAM groups in the send to group page.