You may want to check out MDL-19851 and see if this helps you. I was doing something similar when migrating a site to Moodle. It is a quick and dirty patch but it helped me do what I was looking for. You may want to create an account in the tracker and comment, vote, and/or watch the issue. Peace - Anthony
Bulk User Action - send customized per user message
This discussion has been locked because a year has elapsed since the last post. Please start a new discussion topic.