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

Add certificate link to emails #174

Merged
merged 4 commits into from Mar 18, 2019

Conversation

Projects
None yet
2 participants
@alexsanford
Copy link
Contributor

commented Mar 15, 2019

Fixes #80

This adds a link to "View certificate" to the emails that are sent on course completion. This includes the email to the learner, and the email to the teacher.

Testing instructions

  • In Sensei Settings, ensure email notifications are enabled for both the teacher and the learner when a course is completed.
  • Complete a course.
  • In both the email to the learner, and the email to the teacher, there should be a link to view the certificate.

Implementation note

I moved the certificate generation code to the sensei_course_status_updated hook instead of the sensei_user_course_end hook. This is because we need the certificate to be generated before the emails are sent so that we can access its permalink and add it to the email. The emails are sent on the sensei_course_status_updated with priority 10 (see the code here).

@alexsanford alexsanford self-assigned this Mar 15, 2019

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

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

@donnapep
Copy link
Contributor

left a comment

A few things from me.

Show resolved Hide resolved classes/class-woothemes-sensei-certificates.php Outdated
Show resolved Hide resolved classes/class-woothemes-sensei-certificates.php Outdated
@donnapep
Copy link
Contributor

left a comment

Good stuff. 👍

@alexsanford alexsanford merged commit ec98a25 into master Mar 18, 2019

@alexsanford alexsanford deleted the add/certificate-link-to-emails branch Mar 18, 2019

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.