Generating Certificates

We generate downloadable PDF certificates of completion on the backend. Below are the details to generate certificates already created in the DB for testing purposes.

Prerequisites:

Ensure that you have the following tools installed and setup:

  • pgAdmin for managing the databases
  • Access to the local, staging and production databases as needed

Process

  1. Check the learner_certificates table in the database for existing records. If records exist skip to step 3.

  2. If no records exist you can insert one into the table by running the following on the desired database:

    INSERT INTO public.learner_certificates(
    organisation_id, user_enrollment_id, first_name, last_name, organisation_number, enrollment_date, completion_date, created_at, updated_at, user_id, course_id)
    VALUES ('00000000-0000-0000-0000-000000000001', '61239a20-379f-4ced-a2da-98404aacea9e', 'Hilton', 'Jacobson', 'JCBHIL002', '2020-06-01 15:53:23.38515', '2020-06-01 15:53:23.38515', '2020-06-01 15:53:23.38515', '2020-06-01 15:53:23.38515', '00000000-0000-0000-0000-000000000003', 6);
    

NOTE: The above will create a fake record in the table to be used for testing purposes only and is not to be used for actual learner certificate creation.

  1. Once you have a valid record, you can generate and download the certificate using the following URLs for each of the environments.
  • Local (MacOS not supported by PDF library): http://localhost:3000/download_certificate.pdf?id=[CERTIFICATE_ID]
  • Staging: https://portal.rekindleapps.com/download_certificate.pdf?id=[CERTIFICATE_ID]
  • Production: https://portal.rekindlelearning.com/download_certificate.pdf?id=[CERTIFICATE_ID]