Attach certificate to email
-
Our customer uses Sensei Certificates to generate certificates after a student passed their course.
After the student passed their course we have an automated email including their certificate that gets send to the student.
This function has been working for a long time, but since we updated from php V7.0 to V8.0 this function seems te be broken but sadly enough, but we don’t get any error messages.
As you can see from the code that I included below we use the same function that is used in the Sensei Certificates plugin in: sensei-certificates -> classes -> class-woothemes-sensei-pdf-certificate.php (Line 130).
But when we run this function to generate our PDF nothing get’s created in the email function but the default PDF still get’s generated.
even though both functions are identical and both get the same data passed through them.So the problem that we have basically is that we can’t get the the certificate to download to our server ($path).
As we have checked all the values and there is limited documentation on Sensei Certificates i was hoping you could help me out with our problem.
$fpdf = Woothemes_Sensei_Certificates_TFPDF::get_tfpdf_object($orientation, ‘pt’, array( $image_attr[0], $image_attr[1] )
);$fpdf->AddPage();
$fpdf->SetAutoPageBreak( false );// Add custom font
$custom_font = apply_filters( ‘sensei_certificates_custom_font’, false );
if( $custom_font ) {
if( isset( $custom_font[‘family’] ) && isset( $custom_font[‘file’] ) ) {
$fpdf->AddFont( $custom_font[‘family’], ”, $custom_font[‘file’], true );
}
} else {
// Add multibyte font
$fpdf->AddFont( ‘DejaVu’, ”, ‘DejaVuSansCondensed.ttf’, true );
}// Set the border image as the background
$fpdf->Image( $image, 0, 0, $image_attr[0], $image_attr[1] );do_action( ‘sensei_certificates_before_pdf_output’, $this, $fpdf );
// save the pdf as a file
$fpdf->Output(‘F’, $path);
- The topic ‘Attach certificate to email’ is closed to new replies.