FM_EmailCertificates (Certificates)
Overview
FM_EmailCertificates is a FiLMS module that send emails with an attachment of the earned certificate in a PDF format to earners. This is triggered when an earned certificate is created.
Assuming that the learner has met the requirement(s) to earn a certificate, (s)he earn it when:
(s)he views the list of earned certificates (Top Menu -> Education ->Earned Certificates)
the earned certificate is generated overnight (daily cron)
Installation & Configuration
Installation
It is recommended to install this module non-globally.
Note that FM_EmailTemplates must be installed beforehand.
Configuration
There are 2 organization detail fields for this module.
Organization Detail Field
FMEmailCertificateEmailDetailFieldId
Template ID for Certificate Earned
Description
The ID of the Detail Field that this organization uses to store the E-Mail addresses to send Certificates to
The ID of the E-Mail template to use for the E-Mail sent out
Change Certificate Design / Layout
Below shows the default design of certificate.
Create a new folder called "FM_EmailCertificates" inside either of the global or specific organization id folder in orgresources directory. If that folder is placed inside a specific organization folder, the certificate design will be applied to that organization. If it is placed inside the global folder, the design will be applied to all organizations. The folder will contain a PHP file along with the assets (e.g. logo, background image) that are added to the certificate.
Create a new PHP file called "show_cert_html.php". The file's content should be somewhat similar to this (omit line 3-8). A sample of the file (Husky Certificate Design) can be found in the attachment below.
The PDF generator will use this file to generate the certificate in pdf format. To test it, go to [ENTER FILMS URL]/includes/modules/FM_EmailCertificates/show_cert_pdf.php?intId=[ENTER EARNED CERTIFICATE ID].
Usage
For the Email Template, additional labels are provided:
Label
certificateName
CertificateLink
Description
Certificate Name
URL to certificate ([FiLMS URL]/includes/modules/FM_EmailCertificates/show_cert_pdf?intId=[EARNED CERTIFICATE ID])
Limitation
The design of the certificate is limited on the PDF generator's capabilities
The PDF generator (html2pdf) doesn't like images. When adding the images, make sure that:
the image url is in full path, not relative
the image format must be in jpeg/jpg.
Testing: https://films.dev.icomfiles.com/includes/modules/FM_EmailCertificates/show_cert_pdf.php?intId=415931