Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.

feat: use a braze api-triggered campaign for ent offer usage #3752

Closed
wants to merge 1 commit into from

Conversation

iloveagent57
Copy link
Contributor

@iloveagent57 iloveagent57 commented Jun 23, 2022

Required Testing

  • Before deploying this change, complete a purchase in the stage environment.
    (^ We can remove that manual check once REV-2624 is done and the corresponding e2e test runs again)

Description

Modifies the send_enterprise_offer_limit_emails command , it now:

  • pulls offer usage data from the analytics API service, to be consistent with our stance that our warehouse-based enterprise learner progress report, and its derivatives, are the source of truth about offer state from an accounting perspective. Does this only for "Booking" types of offers, not offers with max_global_applications > 0.
  • Makes the email body a dictionary of key-value pairs consumed by a braze email template, rather than a string.
  • Blocks until the underlying email celery task is done (which is ok b/c this is run from a mgmt command; and I'd rather not write an OfferUsageEmail if the related task actually fails).

Related changes in ecommerce-worker: openedx-unsupported/ecommerce-worker#169

https://2u-internal.atlassian.net/browse/ENT-5940

Testing instructions

Check out openedx-unsupported/ecommerce-worker#169 and make sure you've got ecommerce-worker mounted in your {DEVSTACK_WORKSPACE}/src directory.

From ecommerce shell, do:

pip install -e /edx/src/ecommerce-worker
export WORKER_CONFIGURATION_MODULE='ecommerce_worker.configuration.devstack'
  • Then check logs to make sure ecommerce devserver is restarted.
  • Ensure you have an Enterprise Offer record with email addresses filled out - make it an email address you actually use, because Braze will really send you an email. Prefer to do this with an email/user that already exists in the Braze dev account.
  • Ping @iloveagent57 for a copy of his ecommerce-worker private.py file.
  • Ensure analytics-api local service is running.
  • make analyticsapi-shell
  • Ensure you run the script to seed toy analytics offer data for your test enterprise customer uuid: ./manage.py create_enterprise_offer {customer-uuid}
  • Back in ecommerce-shell, run ./manage.py send_enterprise_offer_limit_emails

Other information

Include anything else that will help reviewers and consumers understand the change.

  • Does this change depend on other changes elsewhere?
  • Any special concerns or limitations? For example: deprecations, migrations, OpenEdx vs. edx.org differences, development vs. production environment differences, security, or accessibility.

@iloveagent57 iloveagent57 force-pushed the aed/offer-usage-email branch from d738c76 to d6e7d28 Compare June 23, 2022 20:10
@iloveagent57 iloveagent57 force-pushed the aed/offer-usage-email branch from d6e7d28 to be3da20 Compare June 23, 2022 20:18
@iloveagent57
Copy link
Contributor Author

closed in favor of forked version: #3753

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant