Skip to contents

Reads metadata (to, subject, optional cc, bcc, thread_id, attachments, labels, from) from the YAML frontmatter at the top of a markdown draft and dispatches to mc_draft().

Usage

mc_md_draft(path, to_self = FALSE, override = list())

Arguments

path

Path to the markdown draft (with YAML frontmatter).

to_self

Logical. If TRUE, address the message to the sender and drop cc, bcc and thread_id, so it reaches nobody else. Default FALSE. Caps the recipients; does not stop the send.

override

Named list of arguments to override frontmatter values at call time (e.g. list(subject = "New subject")). Overrides merge after frontmatter, so override wins.

Value

Invisibly returns whatever mc_draft() returns.

Details

Drafts only. Nothing passed here sends — use mc_md_send() to deliver.

Required frontmatter fields: to, subject. Missing either triggers an error that names the file.

A thread_id in the frontmatter warns: gmailr::gm_create_draft() cannot thread a draft. See mc_draft().

See also

mc_md_send() to send, mc_draft() for the argument-driven form.

Examples

if (FALSE) { # \dontrun{
mc_md_draft("communications/20260413_cindy_newsletter_draft.md")
} # }