|
@@ -2,6 +2,7 @@ import random
|
|
from time import sleep
|
|
from time import sleep
|
|
from django.utils import timezone
|
|
from django.utils import timezone
|
|
from gauth.models import Location
|
|
from gauth.models import Location
|
|
|
|
+from django.conf import settings
|
|
from analytics.send_email import send_email
|
|
from analytics.send_email import send_email
|
|
from .models import Review, CustomReply, Reply
|
|
from .models import Review, CustomReply, Reply
|
|
from nlu_job.nlu_utils import is_a_name
|
|
from nlu_job.nlu_utils import is_a_name
|
|
@@ -64,7 +65,10 @@ def send_email_bad_reviews():
|
|
reviews = get_bad_reviews(location.location_id, hours=6)
|
|
reviews = get_bad_reviews(location.location_id, hours=6)
|
|
total_reviews = reviews.count()
|
|
total_reviews = reviews.count()
|
|
if total_reviews > 0:
|
|
if total_reviews > 0:
|
|
- to = [location.recipient_email if location.recipient_email else 'bt@bytetrek.com.bd']
|
|
|
|
|
|
+ to = settings.ADMIN_MAINTEINER_EMAILS
|
|
|
|
+ # Add location mainteiner email if it has an email
|
|
|
|
+ to.append(location.recipient_email) if location.recipient_email else None
|
|
|
|
+
|
|
subject = f"A bad review has been post in {location.care_name}."
|
|
subject = f"A bad review has been post in {location.care_name}."
|
|
message =f'''
|
|
message =f'''
|
|
<img src="https://ercare24.com/wp-content/uploads/2016/07/signature-care-resized-e1462918690585.png" alt="Avatar" class="image" width=20% >
|
|
<img src="https://ercare24.com/wp-content/uploads/2016/07/signature-care-resized-e1462918690585.png" alt="Avatar" class="image" width=20% >
|