write_quarto_json

Email.write_quarto_json(out_file='.output_metadata.json')

Write the Email to Quarto’s output metadata JSON format.

This method serializes the Email object to JSON in the format expected by Quarto, making it compatible with Quarto’s email integration workflows. This is the inverse of the quarto_json_to_email() ingress function.

Parameters

out_file : str = '.output_metadata.json'

The file path to write the Quarto metadata JSON. Defaults to “.output_metadata.json”.

Returns

: None

Examples

email = Email(
    html="<p>Hello world</p>",
    subject="Test Email",
)
email.write_quarto_json("email_metadata.json")

Notes

The output JSON includes: - email_subject: The subject line - email_attachments: List of attachment file paths - email_body_html: The HTML content of the email - email_body_text: Plain text version (if present) - email_images: Dictionary of base64-encoded inline images (only if not empty) - email_suppress_report_attachment: Suppression flag for report attachments - email_suppress_scheduled: Suppression flag for scheduled sending