Only just noticed the function below. Might be better to merge them into 1 function with a template for the notification messages?