diff --git a/app/models/user.rb b/app/models/user.rb index 7a0c5485d..0a26a254b 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -383,15 +383,17 @@ private def send_organisation_change_email(current_organisation, new_organisation, log_reassignment, logs_count) reassigned_logs_text = "" + assigned_logs_count = logs_count == 1 ? "is 1 log" : "are #{logs_count} logs" + case log_reassignment when "reassign_all" - reassigned_logs_text = "There are #{logs_count} #{'log'.pluralize(logs_count)} assigned to you. The stock owner and managing agent on #{logs_count == 1 ? 'this log' : 'these logs'} has been changed from #{current_organisation.name} to #{new_organisation.name}." + reassigned_logs_text = "There #{assigned_logs_count} assigned to you. The stock owner and managing agent on #{logs_count == 1 ? 'this log' : 'these logs'} has been changed from #{current_organisation.name} to #{new_organisation.name}." when "reassign_stock_owner" - reassigned_logs_text = "There are #{logs_count} #{'log'.pluralize(logs_count)} assigned to you. The stock owner on #{logs_count == 1 ? 'this log' : 'these logs'} has been changed from #{current_organisation.name} to #{new_organisation.name}." + reassigned_logs_text = "There #{assigned_logs_count} assigned to you. The stock owner on #{logs_count == 1 ? 'this log' : 'these logs'} has been changed from #{current_organisation.name} to #{new_organisation.name}." when "reassign_managing_agent" - reassigned_logs_text = "There are #{logs_count} #{'log'.pluralize(logs_count)} assigned to you. The managing agent on #{logs_count == 1 ? 'this log' : 'these logs'} has been changed from #{current_organisation.name} to #{new_organisation.name}." + reassigned_logs_text = "There #{assigned_logs_count} assigned to you. The managing agent on #{logs_count == 1 ? 'this log' : 'these logs'} has been changed from #{current_organisation.name} to #{new_organisation.name}." when "unassign" - reassigned_logs_text = "There are #{logs_count} #{'log'.pluralize(logs_count)} assigned to you. #{logs_count == 1 ? 'This' : 'These'} have now been unassigned." + reassigned_logs_text = "There #{assigned_logs_count} assigned to you. #{logs_count == 1 ? 'This' : 'These'} have now been unassigned." end template_id = ORGANISATION_UPDATE_TEMPLATE_ID