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

alexsanford
Copy link
Contributor

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 Lesson order in drip email is wrong for lessons within modules #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 March 8, 2019 20:00
Copy link
Contributor

@donnapep donnapep left a comment

Choose a reason for hiding this comment

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

Couple of notes on escaping URLs. Otherwise 👍

includes/class-scd-ext-drip-email.php Outdated Show resolved Hide resolved
templates/single-email-drip-notification.php Outdated Show resolved Hide resolved
@alexsanford
Copy link
Contributor Author

Note that I rebased this to fix a conflict

Copy link
Contributor

@jom jom left a comment

Choose a reason for hiding this comment

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

Looks good; works well!

@alexsanford alexsanford merged commit 5038ec4 into master Mar 11, 2019
@alexsanford alexsanford deleted the add/email-template-file branch March 11, 2019 17:17
@richardmtl
Copy link

This is great news!

@regiside
Copy link

regiside commented Sep 3, 2020

Hey,
Not sure if anyone here has access, but it would be nice if this info was added to the Sensei Content Drip documentation. https://senseilms.com/documentation/sensei-content-drip/ The docs are very lacking for anyone trying to do any kind of customization.

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

Successfully merging this pull request may close these issues.

Enable drip email to be customized
5 participants