rich-iannone / quarto-email

MIT License
4 stars 0 forks source link

Include subject in preview (somehow) #14

Closed aronatkins closed 9 months ago

aronatkins commented 10 months ago
---
title: Something wonderful
format: email
email-preview: true
---

Some of the content in this document makes its way to the rendered HTML and
some of it is destined for a custom email message. The email message
customizes the subject and the body of the email, while the rendered HTML
contains only this paragraph.

::: {.email}

::: {.subject}
Buy groceries
:::

Remember to pick up groceries on you way home. Tonight is "breakfast for
dinner" and we're having French Toast!

* Bread
* Eggs
* Butter
* Milk

:::

It would be helpful if the subject were somehow displayed in the email preview.

aronatkins commented 10 months ago

The current email preview with this document:

Screenshot 2024-01-09 at 5 06 37 PM
rich-iannone commented 9 months ago

What I could do is add a separate div above the email body and clearly mark that section as being metadata for the email (i.e., not part of the email message). I’ll put the subject text in there.

Also, you’d like the name of the email HTML file to be index.html, correct? I can make that change as well.

aronatkins commented 9 months ago

That sounds right: The subject at the top, above the email body, possibly separated by a <hr>.

Naming the file index.html would also be nice, as it would be reachable by a .../email-preview/ URL.

rich-iannone commented 9 months ago

Perfect! Can make both of these happen soon.