New activity: Simple Certificate

Re: Simple Certificate - Email notifications

by Andrea Pietro Briganti -
Number of replies: 3

Hello Carlos

I am sorry, maybe my previous explaiation was not super-clear.

The plugin gives the possibility to send an automatic email to someone as soon as the certificate is acquired by the student. The mechanism works well but the body message of the email contains the full name of the student. As per my understanding, but I am not an expert, the text information is in the file named simplecertificate.php located in the lang (en) folder.

I would like to know how to replace the full name of the student with the email address. Here is the current string that seems to refer to the email body text

$string['emailteachermail'] = '

{$a->student} has received their certificate: \'{$a->certificate}\'

for {$a->course}.


You can review it here:


    {$a->url}';


$string['emailteachermailhtml'] = '

{$a->student} has received the certificate: \'<i>{$a->certificate}</i>\'

for {$a->course}.


You can review it here:


    <a href="{$a->url}">Certificate Report</a>.';


In reply to Andrea Pietro Briganti

Re: Simple Certificate - Email notifications

by Carlos Alexandre Fonseca -
Picture of Plugin developers
Hummm ok

Without changing the code it's not possible, you don't need to change simplecertificate.php on lang folders

you must change this code:

https://github.com/bozoh/moodle-mod_simplecertificate/blob/master/locallib.php#L932-L947

in this line https://github.com/bozoh/moodle-mod_simplecertificate/blob/master/locallib.php#L933
you can change $a->student ($info->student) value to what you want
In reply to Carlos Alexandre Fonseca

Re: Simple Certificate - Email notifications

by Andrea Pietro Briganti -

Hello Carlos

many thanks but I have fear to do mistakes. I am not really expert in coding so I would appreciate if yu can give me step by step procedure.

Many thanks

Andrea

In reply to Andrea Pietro Briganti

Re: Simple Certificate - Email notifications

by Carlos Alexandre Fonseca -
Picture of Plugin developers
Don't fear, this plugin is not a "critical component", and mistakes are part of the learning process