Browse Source

feat(AccountRemoval): email sent to admins on data request is optional

Signed-off-by: Jonathan <theflametrooper@gmail.com>
Jonathan 3 years ago
parent
commit
61e5e59094
3 changed files with 4 additions and 2 deletions
  1. 2 1
      backend/config/template.json
  2. 1 1
      backend/index.js
  3. 1 0
      backend/logic/actions/users.js

+ 2 - 1
backend/config/template.json

@@ -9,6 +9,7 @@
 	"registrationDisabled": true,
 	"hideAutomaticallyRequestedSongs": false,
     "hideAnonymousSongs": false,
+	"sendDataRequestEmails": true,
 	"fancyConsole": true,
 	"apis": {
 		"youtube": {
@@ -91,5 +92,5 @@
 			]
 		}
 	},
-	"configVersion": 5
+	"configVersion": 6
 }

+ 1 - 1
backend/index.js

@@ -3,7 +3,7 @@ import "./loadEnvVariables.js";
 import util from "util";
 import config from "config";
 
-const REQUIRED_CONFIG_VERSION = 5;
+const REQUIRED_CONFIG_VERSION = 6;
 
 // eslint-disable-next-line
 Array.prototype.remove = function (item) {

+ 1 - 0
backend/logic/actions/users.js

@@ -281,6 +281,7 @@ export default {
 
 				// send email to all admins of a data removal request
 				(users, next) => {
+					if (!config.get("sendDataRequestEmails")) return next();
 					if (users.length === 0) return next();
 
 					const to = [];