Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

subscription email language update #1892

Merged
merged 2 commits into from
Dec 10, 2024

Conversation

shanbady
Copy link
Contributor

@shanbady shanbady commented Dec 9, 2024

What are the relevant tickets?

Closes https://github.com/mitodl/hq/issues/5888

Description (What does it do?)

This PR changes the subscription email so that when there is more than one resource type in the email (videos + courses + podcasts) it labels it as "learning resources" in the subject line (currently it just arbitrarily picks one resource type from the list)

How can this be tested?

To test this:

  1. checkout this branch
  2. set the required settings in settings.py for email to work (MAILGUN_SENDER_DOMAIN, MAILGUN_KEY,MAILGUN_FROM_EMAIL) from the heroku rc settings.
  3. set NOTIFICATION_EMAIL_BACKEND to "anymail.backends.mailgun.EmailBackend"
  4. restart celery
  5. login locally, make sure your user's email is set to an inbox you have access to.
  6. "subscribe" to all the available provider channels ocw, mitx etc
  7. set some number of learning resources to have a created_on date to today. convenience script:
from learning_resource.models import LearningResource
from main.utils import now_in_utc
resources = LearningResource.objects.all()[:30]
for resource in resources:
	resource.created_on = now_in_utc()
	resource.save()
  1. manually send the daily subscription email via:
from learning_resources_search.tasks import send_subscription_emails
send_subscription_emails("channel_subscription_type") 
  1. you should receive more than one subscription email. The emails that contain only one unique resource type should say the name of the resource type in the header, the emails with mixed resource types should refer to them as "learning resources"

@shanbady shanbady added the Needs Review An open Pull Request that is ready for review label Dec 9, 2024
@shanbady shanbady marked this pull request as ready for review December 9, 2024 20:50
@abeglova abeglova self-assigned this Dec 10, 2024
Copy link
Contributor

@abeglova abeglova left a comment

Choose a reason for hiding this comment

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

lgtm

@shanbady shanbady merged commit c5262d1 into main Dec 10, 2024
11 checks passed
@shanbady shanbady deleted the shanbady/subscription-email-language-update branch December 10, 2024 20:52
@odlbot odlbot mentioned this pull request Dec 11, 2024
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Review An open Pull Request that is ready for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants