This repository has been archived by the owner on May 10, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.Rmd
98 lines (64 loc) · 2.08 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
---
output: github_document
---
[](https://codecov.io/github/ropenscilabs/ponyexpress?branch=master)
# 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
```{r, eval = FALSE}
# Obtain the the development version from GitHub:
# install.packages("devtools")
devtools::install_github("ropenscilabs/ponyexpress")
```
## Functionality
- `parcel_create(df, sender_name, sender_email, subject, template) ` - Creates a template of the messages that need to be sent.
- `parcel_preview()` - will preview the emails
- `parcel_send()` - Send the emails

## Example
__1. Read in data frame__
```{r}
df <- data.frame(
name = c("Lucy", "Karthik"),
email = c("ld.mcgowan@vanderbilt.edu", "kram@berkeley.edu")
)
df
```
__2. Template up__
```{r}
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__
```{r, eval = FALSE}
parcel <- parcel_create(df,
sender_name = "Lucy",
sender_email = "lucydagostino@gmail.com",
subject = "Happy email!",
template = rich_template)
parcel_preview(parcel)
```
__4. Send__
```{r, eval = FALSE}
parcel_send(parcel)
```

