Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/admin/deployment.rst
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ is designed to run daily.

.. code-block:: bash

./manage.py send_oboarding_emails
./manage.py send_onboarding_emails

Send Inactive Account Emails
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down
4 changes: 2 additions & 2 deletions pontoon/messaging/emails.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ def send_monthly_activity_summary():
log.info("Start sending Monthly activity summary emails.")

# Get user monthly actions
users = User.objects.filter(profile__monthly_activity_summary=True)
users = User.objects.filter(is_active=True, profile__monthly_activity_summary=True)
user_month_actions = _get_monthly_user_actions(users, months_ago=1)
previous_user_month_actions = _get_monthly_user_actions(users, months_ago=2)

Expand Down Expand Up @@ -262,7 +262,7 @@ def send_notification_digest(frequency="Daily"):
start_time = timezone.now() - datetime.timedelta(weeks=1)

users = (
User.objects
User.objects.filter(is_active=True)
# Users with the selected notification email frequency
.filter(profile__notification_email_frequency=frequency)
# Users subscribed to at least one email notification type
Expand Down
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should fix the typo in the filename.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I change the the filename, what happens to the ./manage.py send_oboarding_emails command? Is there somewhere else that we are calling that specific command not found in the codebase?

Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ def handle(self, *args, **kwargs):
# Send the 2nd onboarding email to users that have received the 1st email
# and have joined at least ONBOARDING_EMAIL_2_DELAY days ago.
users_for_email_2 = User.objects.filter(
is_active=True,
profile__onboarding_email_status=1,
date_joined__lt=(now() - timedelta(days=settings.ONBOARDING_EMAIL_2_DELAY)),
)
Expand All @@ -22,6 +23,7 @@ def handle(self, *args, **kwargs):
# Send the 3rd onboarding email to users that have received the 2nd email
# and have joined at least ONBOARDING_EMAIL_3_DELAY days ago.
users_for_email_3 = User.objects.filter(
is_active=True,
profile__onboarding_email_status=2,
date_joined__lt=(now() - timedelta(days=settings.ONBOARDING_EMAIL_3_DELAY)),
)
Expand Down