Send email to cdc on new opening.
This commit is contained in:
parent
59c1842370
commit
9260d121e5
|
@ -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"},
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -146,6 +146,9 @@ def sendEmail(email_to, subject, data, template, attachment_jnf_response=None):
|
|||
text_content = strip_tags(html_content)
|
||||
|
||||
email_from = settings.EMAIL_HOST_USER
|
||||
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)
|
||||
|
|
Loading…
Reference in New Issue