Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

email should not receive footer #15

Open
aronatkins opened this issue Jan 10, 2024 · 7 comments
Open

email should not receive footer #15

aronatkins opened this issue Jan 10, 2024 · 7 comments
Assignees
Labels
enhancement New feature or request

Comments

@aronatkins
Copy link
Collaborator

The Quarto email message should not contain any default context. When the user builds a custom email message, they should be given complete control of its content.

Using the Quarto document:

---
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 (quarto)
:::

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

* Bread
* Eggs
* Butter
* Milk

:::

This produces an email message like the following (viewed using the gmail browser UI):

image

In contrast, a custom email from rmarkdown looks like the following:

image

Here is the R Markdown document for comparison:

---
title: Something wonderful
---

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.

```{r echo = FALSE}
rmarkdown::output_metadata$set(
  rsc_email_subject = "Buy groceries (plain rmarkdown)",
  rsc_email_body_html = paste0(c(
    "Remember to pick up groceries on you way home. Tonight is \"breakfast for
dinner\" and we're having French Toast!",
    "",
    "<ul>",
    "<li>Bread</li>",
    "<li>Eggs</li>",
    "<li>Butter</li>",
    "<li>Milk</li>",
    "</ul>",
    ""
  ), collapse = "\n"),
  rsc_email_suppress_report_attachment = TRUE)

```
@aronatkins
Copy link
Collaborator Author

Note: I tried to create an example R Markdown document using blastula, but ran into rstudio/blastula#323

@rich-iannone rich-iannone self-assigned this Jan 12, 2024
@rich-iannone rich-iannone added the enhancement New feature or request label Jan 14, 2024
@rich-iannone
Copy link
Owner

We could definitely remove the inclusion of default content. In a separate issue, we can go over some design ideas for how a user would add content to the email header and footer.

@aronatkins
Copy link
Collaborator Author

Would it be best for me to include examples of how to reference the links in documentation? We don't have any convention for a "message footer" in the document metadata, so whatever is handled as a footer needs to be specified directly in the HTML (and text) email messages.

@rich-iannone
Copy link
Owner

Yes definitely, and I'm thinking about using a .header and .footer class to make these customizable (otherwise they will be empty). Other names which jive with our growing set might be .email-header and .email-footer (this aligns with the .email-text class).

Speaking of which, would an email-footer-default metadata option (defaulting to false) be useful in case people want the default content in the footer? In terms of behavior it could provide the default footer content only if true and if there isn't an .email-footer div.

@rich-iannone
Copy link
Owner

And to answer the question above, yes, I think having some documentation on how to generate the reference links would be useful. It'll probably obviate the need for an email-footer-default option too.

@aronatkins
Copy link
Collaborator Author

I've included an example of using environment variables in my documentation. I think that's probably sufficient for now.

Let's hold off on specialized header/footer divs and ask that folks add that information themselves. They'll need different formatting in the HTML vs text bodies, for example.

@aronatkins
Copy link
Collaborator Author

Blastula incorporates a box containing the email message and some footer information when the secondary email.Rmd contains:

---
output: blastula::blastula_email
---

Quarto email is mimicking this behavior. We will eventually incorporate a "plain" format which lets folks have more control over the email message, but for now, will continue to add this surrounding context.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants