from django.core.mail import send_mail


def send_email(subject, message, recipients=None):
    send_mail(
        subject=subject,
        message=message,
        from_email='noreply@christian-webring.org',
        recipient_list=recipients or ['domdit@gmail.com', 'me@domdit.com'],
        fail_silently=False,
    )


def is_superuser(user):
    if user.is_authenticated:
        return user.is_superuser
    return False


def is_member(user):
    if user.is_authenticated:
        return user.groups.filter(name='Member').exists()
    return False

