Integrate LearnDash LMS with the VerifyEd digital certificate platform.
LearnDash is a learning management system built on Wordpress.
VerifyEd is a digital certificate platform that uses blockchain to verify course completion credentials. One of the advantages of registering the certificates that you issue is that it lets online platforms verify that a course was actually completed. This allows people who complete your courses to show certification badges on LinkedIn for your courses.
This WordPress function automatically sends certification details from LearnDash to VerifyEd which will then issue a digital certificate and send an email to the learner with a link to their certificate.
It also sends errors and notifications to Slack.
Before installing the code, you will need a LearnDash course on Wordpress and a VerifyEd account with a certificate created for your LearnDash course.
You will need to get the course ID for each LearnDash course that you want to integrate with VerifyEd.
To find a LearnDash course ID, in Wordpress got to LearnDash LMS > Courses and edit the desired course.
The course ID is the post
parameter in the URL /post.php?post=xxxx
.
You will need to have set up courses and templates (the VerifyEd certificate) for each course that you want to integrate.
To get your VerifyEd course ID, go to VerifyEd > Courses, select the desired course and click Edit in the popup.
The course ID is the courseIdToEdit
parameter in the URL certToEdit=x&courseId=x&courseIdToEdit=xxxx
.
To get your VerifyEd template ID, go to VerifyEd > Credentials > Credential Designer > Design credential and select View or edit a template.
The template ID is the number at the end of the URL https://app.verifyed.io/designer/xxx
.
You will also need a VerifyEd API key.
In VerifyEd, go to Automation, and select Generate API Key.
Take note of the key.
If you don't want Slack errors and notifications, then you can skip this part, but you should probably delete the Slack code.
- Log in to your Slack web client as an admin.
- Select Configure apps which loads a page in a new tab.
- At the top-right of the new page, select Build, Create New App, and From scratch.
- Give your app a name, select the desired workspace, and continue.
- In the new page that opens, select Incoming webhooks.
- Enable incoming webhooks.
- Create an "errors" webhook and map it to the Slack channel that you want to receive errors on.
- Take note of the Webhooks URL. You will need everything after
https://hooks.slack.com/services/
. - Create a "notifications" webhook and map it to the Slack channel that you want to receive notifications on.
- Take note of the Webhooks URL. You will need everything after
https://hooks.slack.com/services/
.
Copy and paste the code to the bottom of your functions.php
file.
You will need to map your LearnDash course IDs to VerifyEd course and template IDs as seen in the below block.
if ($course_id == <insert course id>) { // replace with learndash course id
$verifyed_template_id = <insert template id>; // replace with verifyed template id
$verifyed_course_id = <insert course id>; // replace with verifyed course id
}
If you have multiple courses, you'll need to add elseif
blocks for each course.
You will need to add constants to your wp-config.php
file with your VerifyEd API key, and your Slack errors and notifications URL fragments.
Add the following lines to your wp-config.php
file:
define( 'VERIFYED_API_KEY', '' );
define( 'SLACK_APPLICATION_ERROR_ID', '' );
define( 'SLACK_APPLICATION_NOTIFICATION_ID', '' );
Be sure to insert the relevant API key and Slack URL fragments before saving.
- Parse the VerifyEd API response and show a link to the new certificate.