Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @staticmethod
- def make_email_config(assunto, email):
- empresa = ModelParametros.get_instance()
- return EmailMultiAlternatives(
- connection=get_connection(
- host=empresa.serveremail_host,
- port=empresa.serveremail_port,
- username=empresa.serveremail_user,
- password=empresa.serveremail_password,
- fail_silently=False
- ),
- from_email=empresa.email_rh,
- to=[email],
- subject=assunto
- )
- @staticmethod
- def enviar_email(assunto, email_destino, mensagem_html, tipo='text/html'):
- email = ModelParametros.make_email_config(assunto, email)
- email.attach_alternative(mensagem_html, tipo)
- email.send(fail_silently=False)
- ModelParametros.enviar_email("Nova senha GCAWEB", email, mensagem_html)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement