Problem emailing certificates

Problem emailing certificates

by Mark Watson -
Number of replies: 0

I am using Moodle 1.9.9+ with Certificate module 2009080900.  I have customised the certificate and it's exactly what my client want.  My problem is with delivery.

I have modified the following line towards the end of  ../mod/certificate/view.php:

//    $filesafe = clean_filename($certificate->name.'.pdf'); 
$filesafe = clean_filename('psa-certificate.pdf');

Problem 1:  When I configure to email the certificate to the user (with SAVE enabled), the certificate is created as expected in moodledata but the received email has no attachment.

Problem 2: My client wanted the certificate output to the screen so that the users could choose to print, save or email (here SAVE is disabled).  The embedded Adobe Save icon pulls up a save window offering to save the file view (I have extensions turned off as would most users).  The file view.pdf will be saved.  If I go to email, however, the subject line has "view.php" and the attachement is "view.php.pdf".  Many mail scanners quite rightly block this.

Is there some way of sending the embedded Adobe window a filename other than view.php?  (Hence my mod to view.php above).

Average of ratings: -