File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -735,17 +735,23 @@ function moodleoverflow_send_mails() {
735
735
}
736
736
737
737
// Send mails to the users with information about the posts.
738
- if ($ users AND $ posts ) {
738
+ if ($ users && $ posts ) {
739
739
740
740
// Send one mail to every user.
741
741
foreach ($ users as $ userto ) {
742
-
742
+
743
743
// Terminate if the process takes more time then two minutes.
744
744
core_php_time_limit::raise (120 );
745
745
746
746
// Tracing information.
747
747
mtrace ('Processing user ' . $ userto ->id );
748
748
749
+ // Check if user wants a resume.
750
+ $ usermailsetting = $ DB ->get_record ('user ' , array ('id ' => $ userto ->id ), $ fields = 'maildigest ' );
751
+ if ($ usermailsetting ->maildigest != 0 ) {
752
+ mtrace ('mailsetting ' . $ usermailsetting ->maildigest );
753
+ continue ;
754
+ }
749
755
// Initiate the user caches to save memory.
750
756
$ userto = clone ($ userto );
751
757
$ userto ->ciewfullnames = array ();
You can’t perform that action at this time.
0 commit comments