The variable declared as "emailcertificatelinktext" in email_certificate_html.mustache is not correct as it is declared as "emailcertificatetext" in email_certificate.php.
Also "emailcertificatelink" is not correct because "$this->cmid" in email_certificate.php returning course module context id instead of course module id.
Maybe the parameter "$customcert->contextid" below can be changed to "$context->instanceid" ?
The variable declared as "emailcertificatelinktext" in email_certificate_html.mustache is not correct as it is declared as "emailcertificatetext" in email_certificate.php.
email_certificate_html.mustache
email_certificate.php
Also "emailcertificatelink" is not correct because "$this->cmid" in email_certificate.php returning course module context id instead of course module id.
Maybe the parameter "$customcert->contextid" below can be changed to "$context->instanceid" ?
email_certificate_task.php