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

Extract email template to a template file #155

Merged
merged 2 commits into from Mar 11, 2019

Conversation

Projects
None yet
4 participants
@alexsanford
Copy link
Contributor

commented Mar 8, 2019

Closes #85

This PR extracts the rendering of the content drip email to a template file. It uses Sensei's template file loading so that the template may be overridden by the theme.

Testing Instructions

Ensure the email template renders properly

  • Create a few courses with some lessons in each one.
  • Set the Content Drip setting for the lessons to a "specific date" and set the date to today.
  • Manually run the woo_scd_daily_cron_hook cron event (the "WP Crontrol" plugin is one way to do this).
  • Ensure that the email is sent properly, and that it looks right. To verify, switch to the master branch, run the event again, and compare the email from the master branch with the email from this branch. They should be identical.
  • Switch back to this branch before continuing.
  • Reorder some dripped lessons within a course that are not in a module. Ensure that the lesson order within the email matches the lesson order in the course. NOTE: this does not work for lessons within a module, and it never did work before. See #154
  • Modify some of the email strings within Sensei > Settings > Content Drip. Send the drip email again. Ensure that the modified strings are used.

Ensure template overriding works

  • In your theme directory, create a subdirectory sensei-content-drip.
  • Copy the templates/single-email-drip-notification.php file into that directory.
  • Modify the single-email-drip-notification.php within the theme.
  • Run the cron event. Ensure that the modified template was used.

@alexsanford alexsanford added this to the 2.0.0 milestone Mar 8, 2019

@alexsanford alexsanford self-assigned this Mar 8, 2019

@alexsanford alexsanford requested review from jom and donnapep Mar 8, 2019

@donnapep
Copy link
Contributor

left a comment

Couple of notes on escaping URLs. Otherwise 👍

Show resolved Hide resolved includes/class-scd-ext-drip-email.php Outdated
Show resolved Hide resolved templates/single-email-drip-notification.php Outdated

@alexsanford alexsanford force-pushed the add/email-template-file branch from 0684158 to 87a2442 Mar 11, 2019

@alexsanford

This comment has been minimized.

Copy link
Contributor Author

commented Mar 11, 2019

Note that I rebased this to fix a conflict

@jom

jom approved these changes Mar 11, 2019

Copy link
Contributor

left a comment

Looks good; works well!

@alexsanford alexsanford merged commit 5038ec4 into master Mar 11, 2019

@alexsanford alexsanford deleted the add/email-template-file branch Mar 11, 2019

@richardmtl

This comment has been minimized.

Copy link

commented Mar 11, 2019

This is great news!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.