fixed email sending for html content type
This commit is contained in:
@@ -65,11 +65,13 @@ class CompanyViewSet(viewsets.ModelViewSet):
|
||||
# send email to company
|
||||
subject = "Contacto de usuario"
|
||||
email = EmailMessage(subject, company_message, to=[instance.creator.email])
|
||||
email.content_subtype = "html"
|
||||
email.send()
|
||||
logging.info(f"Email sent to {instance.creator.email} as manager of {instance.name}")
|
||||
# send confirmation email to user
|
||||
subject = 'Confirmación de contacto'
|
||||
email = EmailMessage(subject, message, to=[request.user.email])
|
||||
email.content_subtype = "html"
|
||||
email.send()
|
||||
logging.info(f"Contact confirmation email sent to {request.user.email}")
|
||||
stats_data = {
|
||||
@@ -98,10 +100,12 @@ class CompanyViewSet(viewsets.ModelViewSet):
|
||||
})
|
||||
# send email to company
|
||||
email = EmailMessage(subject, company_message, to=[instance.creator.email])
|
||||
email.content_subtype = "html"
|
||||
email.send()
|
||||
logging.info(f"Email sent to {instance.creator.email} as manager of {instance.name}")
|
||||
# send confirmation email to user
|
||||
email = EmailMessage(subject, user_message, to=[data['email']])
|
||||
email.content_subtype = "html"
|
||||
email.send()
|
||||
logging.info(f"Contact confirmation email sent to anonymous user {data['email']}")
|
||||
# statslog data to register interaction
|
||||
|
||||
Reference in New Issue
Block a user