README.md

Coverage Status

ponyexpress 🐴

This package builds on the gmailr package and code from Jenny Bryan to automate sending Gmail from R with data from a spreadsheet (local csv, Excel sheet, or a Google sheet). With nothing more than a list of names and email addresses, you can send templated emails (grades, conference acceptances etc)

Install

# Obtain the the development version from GitHub:
# install.packages("devtools")
devtools::install_github("ropenscilabs/ponyexpress")

Functionality

Example

1. Read in data frame

 df <- data.frame(
    name = c("Lucy", "Karthik"),
    email = c("[email protected]", "[email protected]")
  )
  df
##      name                     email
## 1    Lucy [email protected]
## 2 Karthik         [email protected]

2. Template up

library(ponyexpress)
template <- "Dear {name},

   This is a friendly email from me.

  XO,
   Lucy"

 # Or write a rich template!

rich_template <- "Dear {name},

   This is a friendly email from me.
  \\<img src='http://bukk.it/wut.jpg'>
   XO,
   Lucy"

 # Or use one of our templates!
 # Save your text as an object named "body"
 # then use glue!
body <- "Dear {name},

   This is a friendly email from me.
  \\<img src='http://bukk.it/wut.jpg'>
   XO,
   Lucy"
our_template <- glue::glue(glitter_template)

3. Parcel & Preview

  parcel <- parcel_create(df,
              sender_name = "Lucy",
              sender_email = "[email protected]",
              subject = "Happy email!",
              template = rich_template)

 parcel_preview(parcel)            

4. Send

parcel_send(parcel)



ropenscilabs/ponyexpress documentation built on May 28, 2017, 12:54 a.m.