diff --git a/lib/moodlelib.php b/lib/moodlelib.php
index <HASH>..<HASH> 100644
--- a/lib/moodlelib.php
+++ b/lib/moodlelib.php
@@ -1754,7 +1754,7 @@ function set_send_count($user,$reset=false) {
         $pref->name = 'email_send_count';
         $pref->value = 1;
         $pref->userid = $user->id;
-        insert_record('user_preferences',$pref);
+        insert_record('user_preferences',$pref, false);
     }
 }
 
@@ -1772,7 +1772,7 @@ function set_bounce_count($user,$reset=false) {
         $pref->name = 'email_bounce_count';
         $pref->value = 1;
         $pref->userid = $user->id;
-        insert_record('user_preferences',$pref);
+        insert_record('user_preferences',$pref, false);
     }
 }
Merged from MOODLE_<I>_STABLE - Tell insert record we don't care about inserted id