Making the flatfile plugin send only one e-mail to each user

Making the flatfile plugin send only one e-mail to each user

by James Valentine -
Number of replies: 2
Dear Moodlers,

is there any way to prevent Moodle from sending an e-mail for each successful enrolment to users who have already been enrolled on that course (and hence have had their e-mail)?

I have an external system which regenerates the flat file (I can't use the external DB method as I have to use MySQL4) and it includes all enrolled users every time. I cannot set it to include only new users, because the flat file is deleted and there would be no way for the external system to know who had been successfully enrolled and who had not.

Many thanks for your suggestions.
J.
Average of ratings: -
In reply to James Valentine

Re: Making the flatfile plugin send only one e-mail to each user

by James Valentine -
Bump.

Am I going to have to add queries to the enrolment plugin code in order to check that the next user is not already enrolled? Is there a better way?

I would really appreciate some help.

Many thanks,
J.
In reply to James Valentine

Re: Making the flatfile plugin send only one e-mail to each user

by James Valentine -
In the end, I edited the enrolment plugin code to add a DB query if the mail was sent successfully. The purpose of the query was to change my external database to flag that the user was enrolled. I then altered my CSV/flatfile generating code to look for this flag.

Hey presto! No duplicate e-mails and reenrolments. If you'd like the code or some help, please just ask by e-mail (I work for kohera.co.uk) or send me a private message.

Cheers!
J.