diff --git a/apps/settings/api/email.py b/apps/settings/api/email.py index 495e4a15c..2116b969d 100644 --- a/apps/settings/api/email.py +++ b/apps/settings/api/email.py @@ -2,13 +2,14 @@ # from smtplib import SMTPSenderRefused -from rest_framework.views import Response, APIView + +from django.conf import settings from django.core.mail import send_mail, get_connection from django.utils.translation import ugettext_lazy as _ +from rest_framework.views import Response, APIView from common.utils import get_logger from .. import serializers -from django.conf import settings logger = get_logger(__file__) @@ -41,7 +42,7 @@ class MailTestingAPI(APIView): # if k.startswith('EMAIL'): # setattr(settings, k, v) try: - subject = "Test" + subject = settings.EMAIL_SUBJECT_PREFIX + "Test" message = "Test smtp setting" email_from = email_from or email_host_user email_recipient = email_recipient or email_from @@ -68,4 +69,4 @@ class MailTestingAPI(APIView): except Exception as e: logger.error(e) return Response({"error": str(e)}, status=400) - return Response({"msg": self.success_message.format(email_recipient)}) \ No newline at end of file + return Response({"msg": self.success_message.format(email_recipient)})