Rock.Communication.Email.NotifyAdmins C# (CSharp) Method

NotifyAdmins() public static method

Notifies the admins.
Error sending System Email: Could not read Email Medium Entity Type
public static NotifyAdmins ( string subject, string message, string appRoot = "", string themeRoot = "", bool createCommunicationHistory = true ) : void
subject string The subject.
message string The message.
appRoot string The application root.
themeRoot string The theme root.
createCommunicationHistory bool if set to true [create communication history].
return void
        public static void NotifyAdmins( string subject, string message, string appRoot = "", string themeRoot = "", bool createCommunicationHistory = true  )
        {
            try
            {
                List<string> recipients = null;

                Guid adminGroup = Rock.SystemGuid.Group.GROUP_ADMINISTRATORS.AsGuid();
                using ( var rockContext = new RockContext() )
                {
                    recipients = new GroupMemberService( rockContext ).Queryable()
                        .Where( m =>
                            m.Group.Guid.Equals( adminGroup ) &&
                            m.GroupMemberStatus == GroupMemberStatus.Active &&
                            m.Person.Email != null &&
                            m.Person.Email != "" )
                        .Select( m => m.Person.Email )
                        .ToList();
                }

                Email.Send(GlobalAttributesCache.Value("OrganizationEmail"), subject, recipients, message, appRoot, themeRoot, null, createCommunicationHistory );
            }
            catch ( Exception ex )
            {
                ExceptionLogService.LogException( ex, HttpContext.Current );
            }
        }