Hide Group email preferences from user

From UnionCloud Support
Jump to: navigation, search

If all your student groups use an external tool for emailing members you can hide the checkboxes by using the following code.

    // Hide the checkboxes allowing users to update their email preferences for groups they are members of
	$(function() {
		if (window.location.pathname == '/user_groups/my_subscriptions') {
			$('#myaccount-information .tableHeaderRow div.col-12:contains("Receive Emails")').remove();
			$('input[name=is_subscribed]').parent().parent().remove();
		}
	});

Note You should still allow users to give their email preferences, but if this is already provided by the external tool this option removes the confusion.