rich-iannone / quarto-email

MIT License
4 stars 0 forks source link

Handle document that contains `.email` block but no `.subject` block #20

Closed rich-iannone closed 8 months ago

rich-iannone commented 9 months ago

As reported in https://github.com/quarto-dev/quarto-cli/issues/8439, Quarto documents having .email block but no .subject shouldn't result in an error. From @aronatkins , this is a rundown of the expected behavior:

When the document does not include a .subject block, the render should still succeed.

The .output_metadata.json file should include the rsc_email_subject field only when the document is providing a subject.

When Connect renders a document, it provides the RSC_EMAIL_SUBJECT environment variable. This contains the default subject in case folks want to use that value when computing an overridden value. Quarto does not need to interpret RSC_EMAIL_SUBJECT or provide a default subject.

aronatkins commented 9 months ago

Correction made to the parent issue:

The .output_metadata.json file should include a value for the rsc_email_subject field only when the document is providing a subject. When there is no custom subject, the JSON file should either have an empty string value or omit the field.

The field does not need to be omitted; it can either be empty or omitted.

rich-iannone commented 9 months ago

Thank you for echoing that here. This provides good options for a fix.

rich-iannone commented 8 months ago

This is fixed in https://github.com/quarto-dev/quarto-cli/pull/8640.