-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtalk_replies.R
More file actions
82 lines (60 loc) · 2.38 KB
/
Copy pathtalk_replies.R
File metadata and controls
82 lines (60 loc) · 2.38 KB
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
library(gmailr)
library(dplyr)
library(googlesheets)
# get googlesheet data
sheet <- gs_title("CascadiaRConf-Submissions")
dat <- gs_read(sheet, ws = "Ratings summary")
dat <- dat %>% mutate(decision_bool = !is.na(as.numeric(Decision)))
full_talks <- dat %>% filter(grepl("Full talk", `Proposal Type`), decision_bool)
full_talks_accepted <-
full_talks %>%
select(`First Name`, `Last Name`, `Talk Title`, email) %>%
apply(., 1, as.list)
full_talks_no <- dat %>% filter(grepl("Full talk", `Proposal Type`), !decision_bool)
full_talks_notaccepted <-
full_talks_no %>%
select(`First Name`, `Last Name`, `Talk Title`, email) %>%
apply(., 1, as.list)
light_talks <- dat %>% filter(grepl("Lightning", `Proposal Type`), decision_bool)
light_talks_accepted <-
light_talks %>%
select(`First Name`, `Last Name`, `Talk Title`, email) %>%
apply(., 1, as.list)
light_talks_no <- dat %>% filter(grepl("Lightning", `Proposal Type`), !decision_bool)
light_talks_notaccepted <-
light_talks_no %>%
select(`First Name`, `Last Name`, `Talk Title`, email) %>%
apply(., 1, as.list)
# email text
email_text_accepted <- "Hi %s
Congratulations, your CascadiaRConf talk submission '%s' has been accepted!
We're looking forward to your talk!
We'll follow up with more details soon.
Let us know by May 11th if you change your mind - so we can give your slot to
someone else. This is a small conference and we'd like to make sure all
spots are filled.
Do remember to purchase a ticket at https://www.eventbrite.com/e/cascadia-r-conference-tickets-33779595680
Sincerely,
CascadiaRConf Organizers
(sent using `gmailr`)
"
email_text_not_accepted <- "Hi %s
Thank you so so much for your submission. However, we regret to say that
your CascadiaRConf talk submission '%s' was not accepted.
We hope you still would like to attend :) And we hope to run this event next year, so they'll be another chance then.
If you want to buy a ticket you can do so at https://www.eventbrite.com/e/cascadia-r-conference-tickets-33779595680
Sincerely,
CascadiaRConf Organizers
(sent using `gmailr`)
"
# send emails
lapply(light_talks_notaccepted, function(z) {
mime() %>%
from("pdxrlang@gmail.com") %>%
to(z$email) %>%
#to("myrmecocystus@gmail.com") %>%
subject("Your CascadiaRConf talk submission") %>%
text_body(sprintf(email_text_not_accepted, z$`First Name`, z$`Talk Title`)) %>%
#create_draft()
send_message()
})