
Create a Gmail draft from a markdown file with YAML frontmatter
Source:R/mc_md_draft.R
mc_md_draft.RdReads 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 dropcc,bccandthread_id, so it reaches nobody else. DefaultFALSE. 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, sooverridewins.
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.