Exesize
1from celery import shared_task2from django.core.mail import send_mail3
4from authapp.models import User5
6
7@shared_task
8def send_feedback_to_email(message_body: str, message_from: int = None) -> None:9if message_from is not None:10user_from = User.objects.filter(pk=message_from).first().get_full_name()11else:12user_from = 'Anonimus'13
14send_mail(15subject=f"Feedback from: {user_from}",16message=message_body,17recipient_list=["support@lms.local"],18from_email="user@lms.local",19fail_silently=False20)21