# Path: brasilcomvc/common/email.py
# def send_template_email(subject, to, template_name, context=None):
#     '''
#     Render a template into an email body and send it through Django's send_mail
# 
#     - The `to` parameter must be a single email address.
#     - This function omits `from_email` because it expects it to exist from an
#     environment variable.
#     - Other parameters are omitted as well because there are no
#     use for them in the current use case.
#     '''
#     body = render_to_string(template_name, context or {}, Context({
#         'mailing_address': settings.MAILING_ADDRESS,
#         'site_url': settings.BASE_URL,
#         'sns_facebook': settings.SNS_FACEBOOK,
#         'sns_googleplus': settings.SNS_GOOGLEPLUS,
#         'sns_twitter': settings.SNS_TWITTER,
#         'subject': subject,
#     }))
#     plain_body = strip_tags(body)
# 
#     email = EmailMultiAlternatives(
#         subject=subject,
#         body=plain_body,
#         to=(to,))
#     email.attach_alternative(body, 'text/html')
#     email.send()


from django.contrib.auth.models import (
    AbstractBaseUser,
    BaseUserManager,
    PermissionsMixin,
)
from django.db import models
from imagekit.models import ImageSpecField, ProcessedImageField
from imagekit.processors import ResizeToFill
from brasilcomvc.common.email import send_template_email
    date_updated = models.DateTimeField(auto_now=True)
    is_active = models.BooleanField(editable=False, default=True)
    is_staff = models.BooleanField(editable=False, default=False)

    # Notifications
    email_newsletter = models.BooleanField(default=True)

    # Verbose names
    email.verbose_name = 'e-mail'
    full_name.verbose_name = 'nome completo'
    username.verbose_name = 'nome de usuário'
    picture.verbose_name = 'foto do usuário'
    job_title.verbose_name = 'profissão'
    bio.verbose_name = 'biografia'

    USERNAME_FIELD = 'email'
    REQUIRED_FIELDS = ('full_name',)

    objects = UserManager()

    class Meta:
        verbose_name = 'usuário'

    def get_short_name(self):
        return self.full_name.split()[0] if self.full_name else ''

    def get_full_name(self):
        return self.full_name

    def send_welcome_email(self):

# Path: brasilcomvc/common/email.py
# def send_template_email(subject, to, template_name, context=None):
#     '''
#     Render a template into an email body and send it through Django's send_mail
# 
#     - The `to` parameter must be a single email address.
#     - This function omits `from_email` because it expects it to exist from an
#     environment variable.
#     - Other parameters are omitted as well because there are no
#     use for them in the current use case.
#     '''
#     body = render_to_string(template_name, context or {}, Context({
#         'mailing_address': settings.MAILING_ADDRESS,
#         'site_url': settings.BASE_URL,
#         'sns_facebook': settings.SNS_FACEBOOK,
#         'sns_googleplus': settings.SNS_GOOGLEPLUS,
#         'sns_twitter': settings.SNS_TWITTER,
#         'subject': subject,
#     }))
#     plain_body = strip_tags(body)
# 
#     email = EmailMultiAlternatives(
#         subject=subject,
#         body=plain_body,
#         to=(to,))
#     email.attach_alternative(body, 'text/html')
#     email.send()


# Path: brasilcomvc/accounts/models.py
from django.contrib.auth.models import (
    AbstractBaseUser,
    BaseUserManager,
    PermissionsMixin,
)
from django.db import models
from imagekit.models import ImageSpecField, ProcessedImageField
from imagekit.processors import ResizeToFill
from brasilcomvc.common.email import send_template_email

    date_updated = models.DateTimeField(auto_now=True)
    is_active = models.BooleanField(editable=False, default=True)
    is_staff = models.BooleanField(editable=False, default=False)

    # Notifications
    email_newsletter = models.BooleanField(default=True)

    # Verbose names
    email.verbose_name = 'e-mail'
    full_name.verbose_name = 'nome completo'
    username.verbose_name = 'nome de usuário'
    picture.verbose_name = 'foto do usuário'
    job_title.verbose_name = 'profissão'
    bio.verbose_name = 'biografia'

    USERNAME_FIELD = 'email'
    REQUIRED_FIELDS = ('full_name',)

    objects = UserManager()

    class Meta:
        verbose_name = 'usuário'

    def get_short_name(self):
        return self.full_name.split()[0] if self.full_name else ''

    def get_full_name(self):
        return self.full_name

    def send_welcome_email(self):

        send_template_email(