summaryrefslogtreecommitdiff
path: root/workshop_app/send_mails.py
diff options
context:
space:
mode:
authorAkshen2017-04-06 11:28:38 +0530
committerAkshen2017-05-19 15:30:31 +0530
commit042fd3efa7bee7505508f30a2e291c11e615da37 (patch)
tree298e8a331c954a97a6b0fa7e950f602397427f05 /workshop_app/send_mails.py
parentee1df45a5ead61691175009d2f6a93c95f31f5ad (diff)
downloadworkshop_booking-042fd3efa7bee7505508f30a2e291c11e615da37.tar.gz
workshop_booking-042fd3efa7bee7505508f30a2e291c11e615da37.tar.bz2
workshop_booking-042fd3efa7bee7505508f30a2e291c11e615da37.zip
Mailing Done
ToDo multiple instructor workshops fetching and handling
Diffstat (limited to 'workshop_app/send_mails.py')
-rw-r--r--workshop_app/send_mails.py55
1 files changed, 34 insertions, 21 deletions
diff --git a/workshop_app/send_mails.py b/workshop_app/send_mails.py
index 0d4173b..e81168c 100644
--- a/workshop_app/send_mails.py
+++ b/workshop_app/send_mails.py
@@ -9,51 +9,64 @@ from workshop_portal.settings import (
def send_email(request, call_on,
user_position=None, workshop_date=None,
- workshop_title=None, user_name=None
+ workshop_title=None, user_name=None,
+ other_email=None
):
'''
Email sending function while registration and
booking confirmation.
'''
- if call_on == 'Registration':
- if user_position == 'instructor':
- message = 'Thank You for Registering on this platform. \n \
+ if call_on == "Registration":
+ if user_position == "instructor":
+ message = "Thank You for Registering on this platform. \n \
Since you have ask for Instructor Profile, \n \
we will get back to you soon after verifying your \n \
profile. \
- In case if you don\'t get any response within 3days, \
- Please contact us at '
+ In case if you don\t get any response within 3days, \
+ Please contact us at "
send_mail(
- 'Welcome to FOSSEE', message, EMAIL_HOST_USER,
+ "Welcome to FOSSEE", message, EMAIL_HOST_USER,
[request.user.email], fail_silently=False
)
#Send a mail to admin as well as a notification.
else:
- message = 'Thank You for Registering on this platform.\n \
+ message = "Thank You for Registering on this platform.\n \
Rules. \n \ If you face any issue during \
- your session please contact fossee.'
+ your session please contact fossee."
send_mail(
- 'Welcome to FOSSEE', message, EMAIL_HOST_USER,
+ "Welcome to FOSSEE", message, EMAIL_HOST_USER,
[request.user.email], fail_silently=False
)
- elif call_on == 'Booking':
- if user_position == 'instructor':
- message = 'You got a workshop booking request \
- from ' + user_name + ' for \
- ' + workshop_title + ' on ' + workshop_date + ' please respond.'
+ elif call_on == "Booking":
+ if user_position == "instructor":
+ message = "You got a workshop booking request from "+user_name+" for "+workshop_title+" on "+workshop_date+" please respond."
send_mail(
- 'Python Workshop Booking | FOSSEE', message, EMAIL_HOST_USER,
- [request.user.email], fail_silently=False
+ "Python Workshop Booking | FOSSEE", message, EMAIL_HOST_USER,
+ [other_email], fail_silently=False
)
else:
- message = 'Thank You for Booking on this platform.\n \
- ' + user_name +' \
+ message = "Thank You for Booking on this platform.\
+ Here are your workshop details " +workshop_title+ "\
If you face any issue during your session please contact \
- fossee.'
+ fossee."
send_mail(
- 'Python Workshop Booking | FOSSEE', message, EMAIL_HOST_USER,
+ "Python Workshop Booking | FOSSEE", message, EMAIL_HOST_USER,
[request.user.email], fail_silently=False
)
+
+ elif call_on == "Booking Confirmed":
+ if user_position == "instructor":
+ message = "You have confirmed the booking"
+ send_mail("Python Workshop Booking Confirmation", message, EMAIL_HOST_USER,
+ [request.user.email], fail_silently=False)
+ else:
+ message = "Your workshop for "+workshop_date+"request has been confirmed"
+ send_mail("Python Workshop Booking Confirmation", message, EMAIL_HOST_USER,
+ [other_email], fail_silently=False)
+ else:
+ message = "Issue at Workshop Booking App please check"
+ send_mail("Issue At Workshop Booking App", message, EMAIL_HOST_USER,
+ [doke.akshen@gmail.com, mahesh.p.gudi@gmail.com, aditya94palaparthy@gmail.com], fail_silently=False)