emayili/ 0000755 0001762 0000144 00000000000 14155611241 011703 5 ustar ligges users emayili/NAMESPACE 0000644 0001762 0000144 00000003444 14155413632 013133 0 ustar ligges users # Generated by roxygen2: do not edit by hand
S3method(Ops,vctrs_address)
S3method(as.character,envelope)
S3method(as.character,header)
S3method(as.character,vctrs_address)
S3method(format,vctrs_address)
S3method(print,envelope)
S3method(print,vctrs_address)
S3method(vec_ptype_abbr,vctrs_address)
S3method(vec_ptype_full,vctrs_address)
export("%>%")
export(address)
export(as.address)
export(attachment)
export(bcc)
export(cc)
export(comments)
export(compliant)
export(display)
export(domain)
export(encrypt)
export(envelope)
export(expires)
export(from)
export(gmail)
export(html)
export(importance)
export(inreplyto)
export(keywords)
export(local)
export(mailersend)
export(mailgun)
export(parties)
export(priority)
export(qp_decode)
export(qp_encode)
export(raw)
export(references)
export(render)
export(reply)
export(replyby)
export(request_receipt_read)
export(return_path)
export(sender)
export(sendgrid)
export(sendinblue)
export(sensitivity)
export(server)
export(subject)
export(text)
export(to)
import(curl)
import(digest)
import(dplyr)
import(htmltools)
import(logger)
import(purrr)
import(stringr)
import(tidyr)
import(xml2)
importFrom(base64enc,base64encode)
importFrom(commonmark,markdown_html)
importFrom(glue,glue)
importFrom(httr,http_date)
importFrom(magrittr,"%>%")
importFrom(mime,guess_type)
importFrom(rmarkdown,html_document)
importFrom(rmarkdown,render)
importFrom(stats,setNames)
importFrom(stringi,stri_replace_all_fixed)
importFrom(stringi,stri_replace_all_regex)
importFrom(tools,file_ext)
importFrom(urltools,url_decode)
importFrom(utils,packageVersion)
importFrom(vctrs,field)
importFrom(vctrs,new_rcrd)
importFrom(vctrs,vec_assert)
importFrom(vctrs,vec_cast_common)
importFrom(vctrs,vec_ptype_abbr)
importFrom(vctrs,vec_ptype_full)
importFrom(vctrs,vec_recycle_common)
importFrom(xfun,read_utf8)
emayili/tools/ 0000755 0001762 0000144 00000000000 14155162547 013055 5 ustar ligges users emayili/tools/check.R 0000644 0001762 0000144 00000001445 14155162547 014261 0 ustar ligges users library(dplyr)
# spelling::spell_check_package()
devtools::check(cran = TRUE)
# Incoming feasibility checks for CRAN.
#
devtools::check(
manual = TRUE,
remote = TRUE,
incoming = TRUE
)
# Check it on Windows.
#
devtools::check_win_devel()
rhub::check_for_cran()
# Check on macOS.
#
rhub::check_for_cran(
platforms = rhub::platforms() %>%
filter(categories == "macOS") %>%
pull(name),
env_vars = c(
`_R_CHECK_FORCE_SUGGESTS_` = "true",
`_R_CHECK_CRAN_INCOMING_USE_ASPELL_` = "false"
)
)
# # Try this one instead?
# #
# rhub::check(platform = c("macos-highsierra-release"))
#
# rhub::check_for_cran(
# platforms = "macos-highsierra-release-cran",
# env_vars = c(
# `_R_CHECK_FORCE_SUGGESTS_` = "true",
# `_R_CHECK_CRAN_INCOMING_USE_ASPELL_` = "false"
# )
# )
emayili/tools/coverage.R 0000644 0001762 0000144 00000000207 14147344744 014774 0 ustar ligges users library(covr)
# Tests that are skipped on CRAN should still be included in coverage report.
#
Sys.setenv(NOT_CRAN = "true")
report()
emayili/README.md 0000644 0001762 0000144 00000024376 14155410243 013175 0 ustar ligges users
# emayili
[](https://cran.r-project.org/package=emayili)

[](https://codecov.io/github/datawookie/emayili)
[](https://lifecycle.r-lib.org/articles/stages.html)
`{emayili}` is a package for sending emails from R. The design goals
are:
- works on all manner of SMTP servers and
- has minimal dependencies (or dependencies which are easily
satisfied).
The package name is an adaption of the Zulu word for email, *imeyili*.
The documentation for `{emayili}` can be found
[here](https://datawookie.github.io/emayili/).
## Installation
Get the stable version from
[CRAN](https://CRAN.R-project.org/package=emayili).
``` r
install.packages("emayili")
```
Or grab it directly from
[GitHub](https://github.com/datawookie/emayili).
``` r
# Install from the master branch.
remotes::install_github("datawookie/emayili")
# Install from the development branch.
remotes::install_github("datawookie/emayili", ref = "dev")
```
## Usage
Load the library.
``` r
library(emayili)
packageVersion("emayili")
```
[1] '0.7.0'
Create a message object.
``` r
email <- envelope()
```
### Creating a Message
The message has class `envelope`.
``` r
class(email)
```
[1] "envelope"
Add addresses for the sender and recipient.
``` r
email <- email %>%
from("alice@yahoo.com") %>%
to("bob@google.com") %>%
cc("craig@google.com")
```
There are also `bcc()` and `reply()` functions for setting the `Bcc` and
`Reply-To` fields.
You can supply multiple addresses in a variety of formats:
- as a single comma-separated string
- as separate strings; or
- as a vector of strings.
``` r
envelope() %>% to("bob@google.com, craig@google.com, erin@gmail.com")
envelope() %>% to("bob@google.com", "craig@google.com", "erin@gmail.com")
envelope() %>% to(c("bob@google.com", "craig@google.com", "erin@gmail.com"))
```
Add a subject.
``` r
email <- email %>% subject("This is a plain text message!")
```
Add a text body.
``` r
email <- email %>% text("Hello!")
```
You can use `html()` to add an HTML body. It accepts either a vector of
characters or a `tagList()` from `{htmltools}`.
``` r
library(htmltools)
email <- email %>% html(
tagList(
h2("Hello"),
p("World!")
)
)
```
Add an attachment.
``` r
email <- email %>% attachment("image.jpg")
```
You can also create the message in a single command:
``` r
email <- envelope(
to = "bob@google.com",
from = "alice@yahoo.com",
subject = "This is a plain text message!",
text = "Hello!"
)
```
Simply printing a message displays the header information.
``` r
email
```
Date: Sun, 12 Dec 2021 15:09:23 GMT
X-Mailer: {emayili}-0.7.0
MIME-Version: 1.0
From: alice@yahoo.com
To: bob@google.com
Cc: craig@google.com
Subject: This is a plain text message!
You can identify emails which have been sent using `{emayili}` by the
presence of an `X-Mailer` header which includes both the package name
and version.
If you want to see the complete MIME object, just convert to a string.
You can also call the `print()` method and specify `details = TRUE`.
### Options
You can set the `envelope.details` option to assert that the details
should always be printed.
``` r
# Always print envelope details.
#
options(envelope.details = TRUE)
```
By default the results returned by most of the methods are invisible.
You can make them visible via the `envelope.invisible` (default:
`TRUE`).
``` r
# Always show envelope.
#
options(envelope.invisible = FALSE)
```
### Interpolating Text
You can use `{glue}` syntax to interpolate content into the body of a
message.
``` r
name <- "Alice"
envelope() %>%
text("Hello {{name}}!")
```
Date: Sun, 12 Dec 2021 15:09:23 GMT
X-Mailer: {emayili}-0.7.0
MIME-Version: 1.0
Content-Type: text/plain;
charset=utf-8;
format=flowed
Content-Disposition: inline
Content-Transfer-Encoding: 7bit
Content-MD5: nhjeY5ZYMzru+kSCGUzNKg==
Hello Alice!
### Rendering Markdown
You can render Markdown straight into a message.
Use either plain Markdown.
``` r
envelope() %>%
# Render plain Markdown from a character vector.
render(
"Check out [`{emayili}`](https://cran.r-project.org/package=emayili)."
)
```
Date: Sun, 12 Dec 2021 15:09:23 GMT
X-Mailer: {emayili}-0.7.0
MIME-Version: 1.0
Content-Type: text/html;
charset=utf-8
Content-Disposition: inline
Check out {emayili}
.
Or R Markdown.
``` r
envelope() %>%
# Render R Markdown from a file.
render("message.Rmd")
```
In both cases the function will accept either a file path or a character
vector containing Markdown text.
Interpolation also works with `render()`.
### Rendered CSS
When you render an R Markdown document the resulting HTML includes CSS
from three sources:
- [Bootstrap](https://getbootstrap.com/)
- [highlightjs](https://highlightjs.org/) and
- `{rmarkdown}`.
You can control which of these propagate to the message using the
`include_css` parameter which, by default, is set to
`c("rmd", "bootstrap", "highlight")`.
🚨 *Note:* Gmail doesn’t like the Bootstrap CSS. If you want your styling
to work on Gmail you should set `include_css = c("rmd", "highlight")`.
### Extra CSS
You can insert extra CSS into your rendered messages.
``` r
envelope() %>%
render("message.Rmd", css_files = "extra.css")
```
If you are having trouble getting this to work with Gmail then it might
be worthwhile taking a look at their [CSS
support](https://developers.google.com/gmail/design/css).
### Adding an Inline Image
Adding an inline image to an HTML message is possible. There are two
ways to achieve this.
*1. Base64 Encoding*
First you’ll need to [Base64
encode](https://en.wikipedia.org/wiki/Base64) the image.
``` r
img_base64 <- base64enc::base64encode("image.jpg")
```
Then create the HTML message body.
``` r
html_body <- sprintf('
', img_base64)
```
And finally add it to the email.
``` r
email <- envelope() %>% html(html_body)
```
*Note:* It’s important that you specify the appropriate media type
(`image/jpeg` for JPEG and `image/png` for PNG).
*2. Using a CID*
Unfortunately some mail clients (like Gmail) will not display Base64
encoded images. In this case using a CID is a working alternative.
First create the message body which references an image by CID.
``` r
html_body <- '
'
```
Then attach the image and specify the `cid` argument.
``` r
email <- envelope() %>%
html(html_body) %>%
attachment(path = "image.jpg", cid = "image")
```
### Sending a Message
Create a SMTP server object and send the message.
``` r
smtp <- server(
host = "smtp.gmail.com",
port = 465,
username = "bob@gmail.com",
password = "bd40ef6d4a9413de9c1318a65cbae5d7"
)
smtp(email, verbose = TRUE)
```
To see the guts of the message as passed to the SMTP server:
``` r
print(email, details = TRUE)
```
### Using STARTTLS
If you’re trying to send email with a host that uses the STARTTLS
security protocol (like Google Mail, Yahoo! or AOL), then it will most
probably be blocked due to insufficient security. In order to circumvent
this, you can grant access to less secure apps.
## Standards Documents
The following (draft) standards documents relate to emails:
- [RFC 2822](https://tools.ietf.org/html/rfc2822)
- [RFC 5322](https://tools.ietf.org/html/rfc5322)
- [RFC 6854](https://tools.ietf.org/html/rfc6854) (an update to RFC
5322).
## Similar Packages
There is a selection of other R packages which also send emails:
- [blastula](https://cran.r-project.org/package=blastula)
- [blatr](https://cran.r-project.org/package=blatr) (Windows)
- [gmailr](https://cran.r-project.org/package=gmailr)
- [mail](https://cran.r-project.org/package=mail)
- [mailR](https://cran.r-project.org/package=mailR)
- [sendmailR](https://cran.r-project.org/package=sendmailR)
- [ponyexpress](https://github.com/ropensci-archive/ponyexpress)
## Developer Notes
### Code Coverage
You can find the test coverage report at
[Codecov](https://app.codecov.io/gh/datawookie/emayili). For development
purposes it’s more convenient to use the
[`{covr}`](https://cran.r-project.org/package=covr) package.
Generate a coverage report.
``` r
library(covr)
# Tests that are skipped on CRAN should still be included in coverage report.
#
Sys.setenv(NOT_CRAN = "true")
report()
```
Calculate test coverage.
``` r
coverage <- package_coverage()
```
Coverage statistics as a data frame.
``` r
as.data.frame(coverage)
```
Show lines without coverage.
``` r
zero_coverage(coverage)
```
### Checks
Check spelling.
``` r
spelling::spell_check_package()
```
Use [rhub](https://r-hub.github.io/rhub/) to test on various platforms.
``` r
# Check for a specific platform.
#
rhub::check(platform = "debian-gcc-devel")
rhub::check_on_windows(check_args = "--force-multiarch")
rhub::check_on_solaris()
# Check on a bunch of platforms.
#
rhub::check_for_cran()
# Check on important platforms.
#
rhub::check_for_cran(platforms = c(
"debian-gcc-release",
"ubuntu-gcc-release",
"macos-m1-bigsur-release",
"windows-x86_64-release",
NULL
))
```
emayili/man/ 0000755 0001762 0000144 00000000000 14155404046 012461 5 ustar ligges users emayili/man/new_address.Rd 0000644 0001762 0000144 00000001264 14132315227 015246 0 ustar ligges users % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/address.R
\name{new_address}
\alias{new_address}
\title{Helper function for creating address objects}
\usage{
new_address(
email = character(),
display = character(),
local = character(),
domain = character(),
normalise = TRUE
)
}
\arguments{
\item{email}{Email address.}
\item{display}{Display name.}
\item{local}{Local part of email address.}
\item{domain}{Domain part of email address.}
\item{normalise}{Whether to try to normalise address to RFC-5321 requirements.}
}
\value{
An \code{address} object, representing an email address.
}
\description{
Helper function for creating address objects
}
emayili/man/request_receipt_read.Rd 0000644 0001762 0000144 00000000741 14144403400 017137 0 ustar ligges users % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/header-receipt.R
\name{request_receipt_read}
\alias{request_receipt_read}
\title{Request read receipt}
\usage{
request_receipt_read(msg, addr = NULL)
}
\arguments{
\item{msg}{A message object.}
\item{addr}{Single address.}
}
\value{
A message object.
}
\description{
Request the recipient to acknowledge that they have read the message. Inserts
MDN (Message Disposition Notification) header entries.
}
emayili/man/comments.Rd 0000644 0001762 0000144 00000001204 14134234077 014574 0 ustar ligges users % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/header-mail.R
\name{comments}
\alias{comments}
\title{Add or query comments of message.}
\usage{
comments(msg, comments = NULL)
}
\arguments{
\item{msg}{A message object.}
\item{comments}{Comments for the message.}
}
\value{
A message object or the comments of the message object (if \code{comments} is \code{NULL}).
}
\description{
Add or query comments of message.
}
\examples{
# Create a message and set the comments.
msg <- envelope() \%>\% comments("This is a comment")
# Retrieve the comments for a message.
comments(msg)
}
\seealso{
\code{\link{subject}}
}
emayili/man/sensitivity.Rd 0000644 0001762 0000144 00000001763 14134234077 015353 0 ustar ligges users % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/header-sensitivity.R
\name{sensitivity}
\alias{sensitivity}
\title{Set or query message sensitivity}
\usage{
sensitivity(msg, sensitivity = NULL)
}
\arguments{
\item{msg}{A message object.}
\item{sensitivity}{Sensitivity level. One of \code{"personal"}, \code{"private"}, or \code{"company-confidential"}.}
}
\value{
A message object.
}
\description{
Manipulate the \code{Sensitivity} field as specified in \href{https://www.ietf.org/rfc/rfc2156.txt}{RFC 2156}.
}
\examples{
# Not sensitive.
envelope() \%>\%
subject("Your daily dose of spam")
# Sensitive personal message.
envelope() \%>\%
subject("The results from your test") \%>\%
sensitivity("personal")
# Sensitive private message.
envelope() \%>\%
subject("Your OTP (don't show this to anybody!") \%>\%
sensitivity("private")
# Sensitive business message.
envelope() \%>\%
subject("Top Secret Strategy Document") \%>\%
sensitivity("company-confidential")
}
emayili/man/addresses.Rd 0000644 0001762 0000144 00000003172 14134234077 014732 0 ustar ligges users % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/header-mail.R
\name{addresses}
\alias{addresses}
\alias{to}
\alias{cc}
\alias{bcc}
\alias{from}
\alias{reply}
\alias{return_path}
\alias{sender}
\title{Add address fields to message}
\usage{
to(msg, ..., append = TRUE)
cc(msg, ..., append = TRUE)
bcc(msg, ..., append = TRUE)
from(msg, addr = NULL)
reply(msg, addr = NULL)
return_path(msg, addr = NULL)
sender(msg, addr = NULL)
}
\arguments{
\item{msg}{A message object.}
\item{...}{Addresses.}
\item{append}{Whether to append or replace addresses.}
\item{addr}{Single address.}
}
\value{
A message object.
}
\description{
Add address fields to message
}
\examples{
# Populating the To field.
msg <- envelope()
msg \%>\% to("bob@gmail.com, alice@yahoo.com")
msg \%>\% to("bob@gmail.com", "alice@yahoo.com")
msg \%>\% to(c("bob@gmail.com", "alice@yahoo.com"))
# Populating the Cc field.
msg <- envelope()
msg \%>\% cc("bob@gmail.com, alice@yahoo.com")
msg \%>\% cc("bob@gmail.com", "alice@yahoo.com")
msg \%>\% cc(c("bob@gmail.com", "alice@yahoo.com"))
# Populating the Bcc field.
msg <- envelope()
msg \%>\% bcc("bob@gmail.com, alice@yahoo.com")
msg \%>\% bcc("bob@gmail.com", "alice@yahoo.com")
msg \%>\% bcc(c("bob@gmail.com", "alice@yahoo.com"))
msg <- envelope()
# Populating the From field.
msg \%>\% from("craig@gmail.com")
# Populating the Reply-To field.
msg <- envelope()
msg \%>\% reply("gerry@gmail.com")
# Populating the Return-Path field.
msg <- envelope()
msg \%>\% return_path("bounced-mail@devnull.org")
# Populating the Sender field.
msg <- envelope()
msg \%>\% sender("on_behalf_of@gmail.com")
}
emayili/man/print.vctrs_address.Rd 0000644 0001762 0000144 00000000672 14132315227 016753 0 ustar ligges users % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/address.R
\name{print.vctrs_address}
\alias{print.vctrs_address}
\title{Print an address object}
\usage{
\method{print}{vctrs_address}(x, ...)
}
\arguments{
\item{x}{An \code{address} object.}
\item{...}{Further arguments passed to or from other methods.}
}
\description{
Print an address object
}
\examples{
gerry <- as.address("gerry@gmail.com")
print(gerry)
}
emayili/man/qp.Rd 0000644 0001762 0000144 00000001160 14153553110 013361 0 ustar ligges users % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/encoding.R
\name{qp}
\alias{qp}
\alias{qp_encode}
\alias{qp_decode}
\title{Quoted-Printable encoding}
\usage{
qp_encode(x, crlf = CRLF)
qp_decode(x)
}
\arguments{
\item{x}{A string for encoding or decoding.}
\item{crlf}{End-of-line characters.}
}
\value{
An encoded string for \code{qp_encode()} or a decoded string for \code{qp_decode()}.
}
\description{
Encode to and decode from Quoted-Printable encoding.
}
\examples{
qp_encode("Mieux vaut être seul que mal accompagné.")
qp_decode("Mieux vaut =C3=AAtre seul que mal accompagn=C3=A9.")
}
emayili/man/as.character.header.Rd 0000644 0001762 0000144 00000000763 14153553110 016536 0 ustar ligges users % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/header.R
\name{as.character.header}
\alias{as.character.header}
\title{Create formatted header.}
\usage{
\method{as.character}{header}(x, width = 28, ...)
}
\arguments{
\item{x}{A header object.}
\item{width}{The width of the head name field.}
\item{...}{Further arguments passed to or from other methods.}
}
\value{
A formatted header field.
}
\description{
Accepts a header object and formats it as a header field.
}
emayili/man/render.Rd 0000644 0001762 0000144 00000006040 14155404046 014227 0 ustar ligges users % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/render.R
\name{render}
\alias{render}
\title{Render Markdown into email}
\usage{
render(
msg,
input,
params = NULL,
squish = TRUE,
css_files = c(),
include_css = c("rmd", "bootstrap", "highlight"),
language = FALSE,
interpolate = TRUE,
.open = "{{",
.close = "}}",
.envir = NULL
)
}
\arguments{
\item{msg}{A message object.}
\item{input}{The input Markdown file to be rendered or a character vector of Markdown text.}
\item{params}{A list of named parameters that override custom parameters specified in the YAML front-matter.}
\item{squish}{Whether to clean up whitespace in rendered document.}
\item{css_files}{Extra CSS files.}
\item{include_css}{Whether to include rendered CSS from various sources (\code{"rmd"} — native R Markdown CSS; \code{"bootstrap"} — Bootstrap CSS; \code{"highlight"} — highlight.js CSS).}
\item{language}{Langauge of content. If \code{FALSE} then will not include
language field. If \code{TRUE} then will attempt to auto-detect language.
Otherwise will use the specified language.}
\item{interpolate}{Whether or not to interpolate into input using \link[glue]{glue}.}
\item{.open}{The opening delimiter.}
\item{.close}{The closing delimiter.}
\item{.envir}{Environment used for \code{glue} interpolation. Defaults to \code{parent.frame()}.}
}
\value{
A message object.
}
\description{
Render either Plain Markdown or R Markdown directly into the body of an email.
If \code{input} is a file then it will be interpreted as R Markdown it its
extension is either \code{"Rmd"} or \code{"Rmarkdown"}. Otherwise it will be
processed as Plain Markdown.
}
\section{Plain Markdown}{
Plain Markdown is processed with \code{\link[commonmark:commonmark]{commonmark::markdown_html()}}.
}
\section{R Markdown}{
R Markdown is processed with \code{\link[rmarkdown:render]{rmarkdown::render()}}.
Regardless of what \code{output} type is specified in the input file,
\code{render()} will always use the \code{"html_document"} output format.
}
\examples{
# Plain Markdown
markdown <- "[This](https://www.google.com) is a link."
filename <- "message.md"
# Render from Markdown in character vector.
msg <- envelope() \%>\% render(markdown)
# Create a file containing Markdown
cat(markdown, file = filename)
# Render from Markdown in file.
msg <- envelope() \%>\% render(filename)
# Cleanup.
file.remove(filename)
# R Markdown
filename <- "gh-doc.Rmd"
# Create an Rmd document from template.
rmarkdown::draft(
filename,
template = "github_document",
package = "rmarkdown",
edit = FALSE
)
# Check for suitable version of Pandoc (https://pandoc.org/).
#
# Need to have version 2.0 or greater to support required --quiet option.
#
pandoc <- rmarkdown::find_pandoc()
suitable_pandoc <- !is.null(pandoc$dir) && grepl("^2", pandoc$version)
# Render from Rmd file.
if (suitable_pandoc) {
msg <- envelope() \%>\%
render(filename, include_css = c("rmd", "highlight"))
}
# Cleanup.
file.remove(filename)
}
\seealso{
\code{\link{text}}, \code{\link{html}}
}
emayili/man/precedence.Rd 0000644 0001762 0000144 00000002272 14132315227 015045 0 ustar ligges users % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/header-precedence.R
\name{precedence}
\alias{precedence}
\alias{priority}
\alias{importance}
\title{Add fields for message importance and priority}
\usage{
priority(msg, priority = NULL)
importance(msg, importance = NULL)
}
\arguments{
\item{msg}{A message object.}
\item{priority}{Priority level. One of \code{"non-urgent"}, \code{"normal"}, or \code{"urgent"}.}
\item{importance}{Importance level. One of \code{"low"}, \code{"normal"}, or \code{"high"}.}
}
\value{
A message object.
}
\description{
A hint to influence transmission speed and delivery.
A hint to the message recipient about how important the message is.
}
\details{
Does not influence transmission speed or delivery.
}
\examples{
# How rapidly does the message need to be delivered?
#
envelope() \%>\%
subject("Deliver this immediately!") \%>\%
priority("urgent")
envelope(priority = "non-urgent") \%>\%
subject("No rush with this.")
# How much attention should be paid by recipient?
#
envelope() \%>\%
subject("Read this immediately!") \%>\%
importance("high")
envelope(importance = "low") \%>\%
subject("Not important at all. Just delete.")
}
emayili/man/as.character.envelope.Rd 0000644 0001762 0000144 00000001025 14132315227 017115 0 ustar ligges users % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/envelope.R
\name{as.character.envelope}
\alias{as.character.envelope}
\title{Create formatted message.}
\usage{
\method{as.character}{envelope}(x, ..., details = TRUE)
}
\arguments{
\item{x}{A message object.}
\item{...}{Further arguments passed to or from other methods.}
\item{details}{Whether or not to display full message content.}
}
\value{
A formatted message object.
}
\description{
Accepts a message object and formats it as a MIME document.
}
emayili/man/attachment.Rd 0000644 0001762 0000144 00000002325 14134462672 015110 0 ustar ligges users % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/attachment.R
\name{attachment}
\alias{attachment}
\title{Add attachments to a message object}
\usage{
attachment(
msg,
path,
name = NA,
type = NA,
cid = NA,
disposition = "attachment"
)
}
\arguments{
\item{msg}{A message object.}
\item{path}{Path to file.}
\item{name}{Name to be used for attachment (defaults to base name of \code{path}).}
\item{type}{MIME type or \cite{NA}, which will result in a guess based on file extension.}
\item{cid}{Content-ID or \code{NA}.}
\item{disposition}{How is attachment to be presented (\code{"inline"} or \code{"attachment"})?}
}
\value{
A message object.
}
\description{
Add attachments to a message object
}
\examples{
path_mtcars <- tempfile(fileext = ".csv")
path_scatter <- tempfile(fileext = ".png")
path_cats <- system.file("cats.jpg", package = "emayili")
write.csv(mtcars, path_mtcars)
png(path_scatter)
plot(1:10)
dev.off()
msg <- envelope() \%>\%
attachment(path_mtcars) \%>\%
# This attachment will have file name "cats.jpg".
attachment(path_cats, name = "cats.jpg", type = "image/jpeg") \%>\%
attachment(path_scatter, cid = "scatter")
file.remove(path_scatter, path_mtcars)
}
emayili/man/raw.Rd 0000644 0001762 0000144 00000000614 14132315227 013537 0 ustar ligges users % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/address.R
\name{raw}
\alias{raw}
\title{Extract raw email address}
\usage{
raw(addr)
}
\arguments{
\item{addr}{An \code{address} object.}
}
\value{
A raw email address.
}
\description{
Strips the display name off an email address (if present).
}
\examples{
gerry <- as.address("Gerald ")
raw(gerry)
}
emayili/man/as.character.MIME.Rd 0000644 0001762 0000144 00000000602 14132315227 016027 0 ustar ligges users % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/mime.R
\name{as.character.MIME}
\alias{as.character.MIME}
\title{Convert MIME object to character vector}
\usage{
\method{as.character}{MIME}(x, ...)
}
\arguments{
\item{x}{MIME object}
\item{...}{Further arguments passed to or from other methods.}
}
\description{
Convert MIME object to character vector
}
emayili/man/text.Rd 0000644 0001762 0000144 00000003722 14155404046 013740 0 ustar ligges users % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/body.R
\name{text}
\alias{text}
\title{Add a text body to a message.}
\usage{
text(
msg,
content,
disposition = "inline",
charset = "utf-8",
encoding = "7bit",
language = FALSE,
interpolate = TRUE,
.open = "{{",
.close = "}}",
.envir = NULL
)
}
\arguments{
\item{msg}{A message object.}
\item{content}{A string of message content.}
\item{disposition}{Should the content be displayed inline or as an
attachment? Valid options are \code{"inline"} and \code{"attachment"}. If
set to \code{NA} then will guess appropriate value.}
\item{charset}{What character set is used. Most often either \code{"UTF-8"}
or \code{"ISO-8859-1"}.}
\item{encoding}{How content is transformed to ASCII. Options are
\code{"7bit"}, \code{"quoted-printable"} and \code{"base64"}. Use \code{NA}
or \code{NULL} for no (or "identity") encoding.}
\item{language}{Langauge of content. If \code{FALSE} then will not include
language field. If \code{TRUE} then will attempt to auto-detect language.
Otherwise will use the specified language.}
\item{interpolate}{Whether or not to interpolate into input using \link[glue]{glue}.}
\item{.open}{The opening delimiter.}
\item{.close}{The closing delimiter.}
\item{.envir}{Environment used for \code{glue} interpolation. Defaults to \code{parent.frame()}.}
}
\value{
A message object.
}
\description{
Add \code{text/plain} content to a message.
}
\details{
The \code{text/plain} format is
described in \href{https://www.ietf.org/rfc/rfc2646.txt}{RFC 2646}.
Uses \code{glue::glue()} to evaluate expressions enclosed in brackets as R code.
}
\examples{
msg <- envelope() \%>\% text("Hello!")
# Using {glue} interpolation.
#
name <- "Alice"
msg <- envelope() \%>\% text("Hello {name}.")
print(msg, details = TRUE)
# Disable {glue} interpolation.
#
msg <- envelope() \%>\% text("This is a set: {1, 2, 3}.", interpolate = FALSE)
}
\seealso{
\code{\link{html}}, \code{\link{render}}
}
emayili/man/domain.Rd 0000644 0001762 0000144 00000000540 14132315227 014213 0 ustar ligges users % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/address.R
\name{domain}
\alias{domain}
\title{Extract domain of email address}
\usage{
domain(addr)
}
\arguments{
\item{addr}{An \code{address} object.}
}
\value{
A character vector.
}
\description{
Extract domain of email address
}
\examples{
domain("alice@example.com")
}
emayili/man/as.address.Rd 0000644 0001762 0000144 00000001140 14132315227 014770 0 ustar ligges users % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/address.R
\name{as.address}
\alias{as.address}
\title{Create an address object}
\usage{
as.address(addr)
}
\arguments{
\item{addr}{An email address.}
}
\value{
An \code{address} object.
}
\description{
Create an address object
}
\examples{
as.address("gerry@gmail.com")
as.address("Gerald ")
as.address(c("Gerald ", "alice@yahoo.com", "jim@aol.com"))
as.address("Gerald , alice@yahoo.com, jim@aol.com")
as.address(c("Gerald ", "alice@yahoo.com, jim@aol.com"))
}
emayili/man/subject.Rd 0000644 0001762 0000144 00000002024 14134462672 014413 0 ustar ligges users % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/header-mail.R
\name{subject}
\alias{subject}
\title{Add or query subject of message.}
\usage{
subject(
msg,
subject = NULL,
interpolate = TRUE,
.open = "{{",
.close = "}}",
.envir = NULL
)
}
\arguments{
\item{msg}{A message object.}
\item{subject}{A subject for the message.}
\item{interpolate}{Whether or not to interpolate into input using \link[glue]{glue}.}
\item{.open}{The opening delimiter.}
\item{.close}{The closing delimiter.}
\item{.envir}{Environment used for \code{glue} interpolation. Defaults to \code{parent.frame()}.}
}
\value{
A message object or the subject of the message object (if \code{subject} is \code{NULL}).
}
\description{
Add or query subject of message.
}
\examples{
# Create a message and set the subject
msg <- envelope() \%>\% subject("Updated report")
# Retrieve the subject for a message
subject(msg)
}
\seealso{
\code{\link{to}}, \code{\link{from}}, \code{\link{cc}}, \code{\link{bcc}} and \code{\link{reply}}
}
emayili/man/format.vctrs_address.Rd 0000644 0001762 0000144 00000000710 14132315227 017100 0 ustar ligges users % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/address.R
\name{format.vctrs_address}
\alias{format.vctrs_address}
\title{Encode email addresses in a common format}
\usage{
\method{format}{vctrs_address}(x, ...)
}
\arguments{
\item{x}{A vector of \code{address} objects.}
\item{...}{Further arguments passed to or from other methods.}
}
\value{
A character vector.
}
\description{
Encode email addresses in a common format
}
emayili/man/envelope.Rd 0000644 0001762 0000144 00000003652 14153553110 014566 0 ustar ligges users % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/envelope.R
\name{envelope}
\alias{envelope}
\title{Create a message.}
\usage{
envelope(
to = NULL,
from = NULL,
cc = NULL,
bcc = NULL,
reply = NULL,
subject = NULL,
importance = NULL,
priority = NULL,
text = NULL,
html = NULL,
encrypt = FALSE,
sign = FALSE,
public_key = FALSE
)
}
\arguments{
\item{to}{See \code{\link[=to]{to()}}.}
\item{from}{See \code{\link[=from]{from()}}.}
\item{cc}{See \code{\link[=cc]{cc()}}.}
\item{bcc}{See \code{\link[=bcc]{bcc()}}.}
\item{reply}{See \code{\link[=reply]{reply()}}.}
\item{subject}{See \code{\link[=subject]{subject()}}.}
\item{importance}{See \code{\link[=importance]{importance()}}.}
\item{priority}{See \code{\link[=priority]{priority()}}.}
\item{text}{See \code{\link[=text]{text()}}.}
\item{html}{See \code{\link[=html]{html()}}.}
\item{encrypt}{Whether to encrypt the message. If \code{TRUE} then the entire
message will be encrypted using the private key of the sender.}
\item{sign}{Whether to sign the message. If \code{TRUE} then the entire message will be signed using the private key of the sender.}
\item{public_key}{Whether to attach a public key. If \code{TRUE} then the public key of the sender will be attached.}
}
\value{
A message object.
}
\description{
Create a message.
}
\examples{
# Create an (empty) message object.
#
msg <- envelope()
# Create a complete message object, specifying all available fields.
#
envelope(
to = "bob@gmail.com",
from = "craig@gmail.com",
cc = "alex@gmail.com",
bcc = "shannon@gmail.com",
reply = "craig@yahoo.com",
importance = "high",
priority = "urgent",
subject = "Hiya!",
text = "Hi Bob, how are you?"
)
}
\seealso{
\code{\link[=subject]{subject()}}, \code{\link[=from]{from()}}, \code{\link[=to]{to()}}, \code{\link[=cc]{cc()}}, \code{\link[=bcc]{bcc()}}, \code{\link[=reply]{reply()}} and
\code{\link[=encrypt]{encrypt()}}.
}
emayili/man/response.Rd 0000644 0001762 0000144 00000002031 14134234077 014604 0 ustar ligges users % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/header-mail.R
\name{response}
\alias{response}
\alias{inreplyto}
\alias{references}
\title{Add In-Reply-To and References header fields}
\usage{
inreplyto(msg, msgid, subject_prefix = "Re: ")
references(msg, msgid, subject_prefix = "Re: ")
}
\arguments{
\item{msg}{A message object.}
\item{msgid}{A message ID. This would be the contents of the \code{Message-ID}
field from another message.}
\item{subject_prefix}{Prefix to add to subject. If specified will be prepended
onto the \code{Subject} field. Set to \code{NULL} if not required.}
}
\value{
A message object.
}
\description{
Add In-Reply-To and References header fields
}
\examples{
envelope() \%>\% inreplyto("<6163c08e.1c69fb81.65b78.183c@mx.google.com>")
# Now for German.
envelope() \%>\%
inreplyto("6163c08e.1c69fb81.65b78.183c@mx.google.com", "AW: ")
# And also for Danish, Norwegian and Swedish (but not Finnish!).
envelope() \%>\%
references("6163c08e.1c69fb81.65b78.183c@mx.google.com", "SV: ")
}
emayili/man/compliant.Rd 0000644 0001762 0000144 00000001316 14132315227 014734 0 ustar ligges users % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/address.R
\name{compliant}
\alias{compliant}
\title{Tests whether an email address is syntactically correct}
\usage{
compliant(addr, error = FALSE)
}
\arguments{
\item{addr}{An email address.}
\item{error}{Whether to create an error if not compliant.}
}
\value{
A Boolean.
}
\description{
Checks whether an email address conforms to the \href{https://en.wikipedia.org/wiki/Email_address#Syntax}{syntax rules}.
}
\details{
An email address may take either of the following forms:
\itemize{
\item \code{local@domain} or
\item \verb{Display Name }.
}
}
\examples{
compliant("alice@example.com")
compliant("alice?example.com")
}
emayili/man/keywords.Rd 0000644 0001762 0000144 00000001632 14134234077 014623 0 ustar ligges users % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/header-mail.R
\name{keywords}
\alias{keywords}
\title{Add or query keywords of message.}
\usage{
keywords(msg, ..., append = FALSE)
}
\arguments{
\item{msg}{A message object.}
\item{...}{Keywords.}
\item{append}{Whether to append or replace keywords.}
}
\value{
A message object or the comments of the message object (if \code{comments} is \code{NULL}).
}
\description{
Add or query keywords of message.
}
\examples{
# Create a message and set the keywords.
envelope() \%>\% keywords("newsletter, marketing")
envelope() \%>\% keywords("newsletter", "marketing")
envelope() \%>\% keywords(c("newsletter", "marketing"))
# Retrieve the keywords for a message.
msg <- envelope() \%>\% keywords("newsletter, marketing")
keywords(msg)
}
\seealso{
\code{\link{to}}, \code{\link{from}}, \code{\link{cc}}, \code{\link{bcc}} and \code{\link{reply}}
}
emayili/man/figures/ 0000755 0001762 0000144 00000000000 14132315227 014122 5 ustar ligges users emayili/man/figures/emayili-hex.png 0000644 0001762 0000144 00000070220 14132315227 017044 0 ustar ligges users PNG
IHDR X .' pHYs .# .#x?v IDATxyxT, !l$@uW\.Ui[[*jUZ.j\@qZEE dȈeMΜs]\&3woy@DDDk.[ bxXlJDDDW&p7Ё>p}HqUlCiSDDD"P;HvEDD$ `=I(W9֓KqTfz^!DDDo\d`-ֿ@ӟGDDDz|s0ҿꀫ~HO(EDDdW_
W#|`_X'
[DDD]n逰_H 1rF/+t@X1ND?/p0dh(2¿hտQ_ ;L}*/5&y
"^`_S}r)xهN_:6P15K`?x4,,"(DmXNHb1Rp/p'tcxV6 *c],"QD@$Axڍ$fCAj.;4j CR]EEoD83U4h/^Oȃ\
!6(>\ **"` bCNf7u \gr=1ؾq
na"e[ہvEgDS8Cߋ.AGS/œn5|ж+e˱6'>btHK:7H3U4cMJR+?fX,*"` ҿN*;IגXS%{,ROzc]ǰl2UTDvN@uhS=)3r=7T>i-3i?&amʼ. n ~.7هFѤkg)iZ7(f:j*LxdQ6H .º'T=xu$idlz*_|`Gүa^aXD;^
)pهndHųwQLz`(08TAwb2y/ĝ`"D[]Fٓв&