GetPaginatedEmailTemplateListAsync(BaseFilter filter)
 {
     if (HasPermission(Permission.ManageBulkEmails))
     {
         return(await _emailTemplateRepository.PageAsync(filter));
     }
     else
     {
         _logger.LogError("User {UserId} doesn't have permission to view the email template list.",
                          GetClaimId(ClaimType.UserId));
         throw new GraException("Permission denied.");
     }
 }