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 );
}
}