diff --git a/CDC_Backend/APIs/companyViews.py b/CDC_Backend/APIs/companyViews.py index 3421b2f..6cca9be 100644 --- a/CDC_Backend/APIs/companyViews.py +++ b/CDC_Backend/APIs/companyViews.py @@ -279,7 +279,7 @@ def verifyEmail(request): "opening_type": PLACEMENT, "company_name": opening.company_name, } - sendEmail(opening.email, COMPANY_OPENING_SUBMITTED_TEMPLATE_SUBJECT.format(id=opening.id), data, + sendEmail([opening.email, CDC_MAIl_ADDRESS], COMPANY_OPENING_SUBMITTED_TEMPLATE_SUBJECT.format(id=opening.id), data, COMPANY_OPENING_SUBMITTED_TEMPLATE, attachment_jnf_respone) return Response({'action': "Verify Email", 'message': "Email Verified Successfully"}, diff --git a/CDC_Backend/APIs/constants.py b/CDC_Backend/APIs/constants.py index 576165e..35afd94 100644 --- a/CDC_Backend/APIs/constants.py +++ b/CDC_Backend/APIs/constants.py @@ -45,6 +45,8 @@ DEGREE_CHOICES = [ TOTAL_BRANCHES = 4 # Total No of Branches TOTAL_BATCHES = 5 # Total No of Batches +CDC_MAIl_ADDRESS = 'cdc@iitdh.ac.in' + # To be Configured Properly CLIENT_ID = os.environ.get('GOOGLE_OAUTH_CLIENT_ID') # Google Login Client ID diff --git a/CDC_Backend/APIs/utils.py b/CDC_Backend/APIs/utils.py index 50bfe9e..4913746 100644 --- a/CDC_Backend/APIs/utils.py +++ b/CDC_Backend/APIs/utils.py @@ -146,7 +146,10 @@ def sendEmail(email_to, subject, data, template, attachment_jnf_response=None): text_content = strip_tags(html_content) email_from = settings.EMAIL_HOST_USER - recipient_list = [str(email_to), ] + if type(email_to) is list: + recipient_list = [str(email) for email in email_to] + else: + recipient_list = [str(email_to), ] msg = EmailMultiAlternatives(subject, text_content, email_from, recipient_list) msg.attach_alternative(html_content, "text/html")