Beginner May 11, 2026 · 1 min read

Overview

The School Certificate desk form now includes an embedded PDF preview section and two role-gated action buttons — Email Certificate and Print Certificate — visible only to users with one of the following roles: School Director, Registrar, System Manager, or Academics User.

PDF Preview

When a certificate has a generated PDF (pdf_file is set), the Preview section at the bottom of the form renders an inline iframe (640 px tall) so staff can verify the certificate without downloading. The preview updates automatically when the PDF is regenerated.

Email Certificate

  1. Open any saved School Certificate record in Frappe Desk.
  2. Click Actions → Email Certificate.
  3. The dialog pre-fills the To field with the student’s student_email_id (or linked User email). Edit if needed.
  4. Optionally add a plain-text note that will appear as the email body.
  5. Click Send. The PDF is attached automatically.

Backend: certificate_engine.email_certificate(cert_name, to_email, note). If no PDF exists it is generated on the fly before sending.

Print Certificate

Actions → Print Certificate opens the PDF in a new browser tab, from which the browser’s native print dialog can be used.

Generating a PDF

If no PDF exists yet, use Actions → Regenerate PDF. This calls certificate_engine.regenerate_certificate_pdf(cert_name) and reloads the form once complete.

Technical Reference

  • school_certificate.js — form refresh hook; _renderPreview() populates the pdf_preview HTML field; _showEmailDialog() handles the dialog
  • certificate_engine.email_certificate() — whitelisted; role-gated; uses frappe.sendmail() with raw PDF bytes as attachment
  • DocType: section_break_preview (depends_on: pdf_file) + pdf_preview (HTML field, no DB column)
  • Shipped in v0.52.0, commit 748db76
Was this article helpful?