Skip to content

email: conditional recipients in rendered email metadata #14023

Description

@juleswg23

We have recently added support for multiple emails rendered from a single document. This next step will allow any/all emails to have conditional recipients.

I am flexible on the format of accepted quarto input, here is a draft of how it might look:

---
title: Email Test Document
author: Charles Teague
format: email
---

The report content. Anything that is here is not part of the email message.

::: {.email}

::: {.subject}
The subject line.
:::

```{python}
import datetime

# Get today's date
today = datetime.date.today()

if today.weekday() < 5:
    recipients = ["test1@test.com", "test2@test.com", "test3@test.com"]
else:
    recipients = ["test4@test.com", "test5@test.com", "test6@test.com"]
```

:::{.recipients}
`{python} recipients`
:::

::: {.email-text}
An optional text-only version of the email message..
:::

The HTML email content. Here you can add code cells, produce images, and write accompanying text.

:::

Any additional report content not part of the email message.

Multiple emails here: #13882

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions