mirror of
https://github.com/HamzaSha1/zod-backend.git
synced 2025-08-25 13:49:40 +00:00
22
account/templates/templated_email/user_activate.email
Normal file
22
account/templates/templated_email/user_activate.email
Normal file
@ -0,0 +1,22 @@
|
||||
{% extends "templated_email/email_base.email" %}
|
||||
|
||||
{% block subject %}
|
||||
Account Activated
|
||||
{% endblock %}
|
||||
|
||||
{% block plain %}
|
||||
<tr>
|
||||
<td style="padding: 0 27px 15px;">
|
||||
<p style="margin: 0; font-size: 16px; line-height: 20px; padding: 36px 0 0; font-weight: 500; color: #1f2532;">
|
||||
Hi User,
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding: 0 27px 22px;">
|
||||
<p style="margin: 0;font-size: 14px; font-weight: 400; line-height: 21px; color: #1f2532;">
|
||||
We're pleased to inform you that your account has been successfully reactivated by our admin team. Welcome back to ZOD ! <br><br> You can now access all the features and services as before. If you have any questions or need assistance, please feel free to reach out to our support team. <br><br> Thank you for being a valued member of our community.
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
{% endblock %}
|
@ -48,6 +48,7 @@ def notify_task_expiry():
|
||||
:return:
|
||||
"""
|
||||
all_pending_tasks = JuniorTask.objects.filter(
|
||||
junior__is_verified=True,
|
||||
task_status__in=[PENDING, IN_PROGRESS],
|
||||
due_date__range=[datetime.datetime.now().date(),
|
||||
(datetime.datetime.now().date() + datetime.timedelta(days=1))])
|
||||
|
@ -24,6 +24,7 @@ User = get_user_model()
|
||||
|
||||
def register_fcm_token(user_id, registration_id, device_id, device_type):
|
||||
""" used to register the fcm device token"""
|
||||
FCMDevice.objects.filter(registration_id=registration_id).delete()
|
||||
device, _ = FCMDevice.objects.update_or_create(user_id=user_id,
|
||||
defaults={'device_id': device_id, 'type': device_type,
|
||||
'active': True,
|
||||
|
@ -120,17 +120,23 @@ class UserManagementViewSet(GenericViewSet, mixins.ListModelMixin,
|
||||
if user_type not in [GUARDIAN, JUNIOR]:
|
||||
return custom_error_response(ERROR_CODE['2067'], status.HTTP_400_BAD_REQUEST)
|
||||
|
||||
email_template = 'user_deactivate.email'
|
||||
|
||||
if user_type == GUARDIAN:
|
||||
obj = Guardian.objects.filter(user_id=kwargs['pk'], is_verified=True).select_related('user').first()
|
||||
elif user_type == JUNIOR:
|
||||
obj = Junior.objects.filter(auth_id=kwargs['pk'], is_verified=True).select_related('auth').first()
|
||||
|
||||
if not obj:
|
||||
return custom_error_response(ERROR_CODE['2004'], status.HTTP_400_BAD_REQUEST)
|
||||
|
||||
if obj.is_active:
|
||||
deactivate_email_template = 'user_deactivate.email'
|
||||
obj.is_active = False
|
||||
send_email([obj.user.email if user_type == GUARDIAN else obj.auth.email], email_template)
|
||||
send_email([obj.user.email if user_type == GUARDIAN else obj.auth.email],
|
||||
deactivate_email_template)
|
||||
else:
|
||||
activate_email_template = 'user_activate.email'
|
||||
obj.is_active = True
|
||||
send_email([obj.user.email if user_type == GUARDIAN else obj.auth.email],
|
||||
activate_email_template)
|
||||
obj.save()
|
||||
return custom_response(SUCCESS_CODE['3038'])
|
||||
|
Reference in New Issue
Block a user