How to send certificate A or certificate B using php?

How to send certificate A or certificate B using php?

by Robin de Rooy -
Number of replies: 5
Is there a possibility to call a function in php to send a certificate?

So if an event is triggered, I check some conditions myself and issue a specific certificate.

Reason: we have a practical course. Sometimes teacher A takes it, sometimes teacher B.
I need the certificate to have the correct signature in the certificate.
I a new_user_profile_field I can put the teacher: A or B.

Functionality is: if in new_profile_field is teacher A then grant certificate A, if teacher B then grant certificate B.

Kind regards,
Robin de Rooy
Average of ratings: -
In reply to Robin de Rooy

Re: How to send certificate A or certificate B using php?

by Mark Nelson -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Testers
Well, it's possible to do whatever you want as long as you know how to code it. smile

This would require a developer to work on and can't be done out of the box. Sorry!
In reply to Mark Nelson

Re: How to send certificate A or certificate B using php?

by Robin de Rooy -
Thanks for the reply Mark. I am a user and developer, but propably have to dig a little deeper. I just added some pseudo code, or even less, to trigger a larger audience.


Do you have, by chance, a summary of funtions to call? Or a reference to this? Thanks for the input and pointing me in the direction.

In reply to Robin de Rooy

Re: How to send certificate A or certificate B using php?

by Mark Nelson -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Testers
https://github.com/mdjnelson/moodle-mod_customcert/blob/MOODLE_402_STABLE/classes/task/email_certificate_task.php#L192 is where the certificate is generated for emails but I suspect that may not help with choosing how it looks. Perhaps if you change the logic in https://github.com/mdjnelson/moodle-mod_customcert/blob/MOODLE_402_STABLE/element/userfield/classes/element.php#L132 you can get the field to work like you want.
In reply to Mark Nelson

Re: How to send certificate A or certificate B using php?

by Robin de Rooy -
Thanks, I will have a look.


My plan is to select a different certificate template, not a single field.

Something like, after 'exam_X_finished' event (cron):

Select case profile_field_examinator

 case examinator_A

  Use_cert_template(cert_template_A)

 case examinator_B

  Use_cert_template(cert_template_B)

case examinator_C

 Use_cert_template(cert_template_C)

End select