#email reminder app

#read google doc

library (googlesheets)
gs_auth()

PIlist = gs_url ("https://docs.google.com/spreadsheets/d/1jVBj0RBZ4zFwtL1dcy-D9UA_QRvkGhX8s5_sWI8toEk/edit#gid=390395480")

data= googlesheets::gs_read_csv(PIlist, skip =2)

remind = data[data$`Data Survey`== "0",]

text2= ""
for (i in c(1:15)) {
  text =paste0("<a href='mailto:", remind$Email[i], "?subject=SFB1315-data&body=Dear Prof. ",remind$`Last name`[i],", '> ",i,remind$`Last name`[i]," </a>")
  text2 = paste0 (text2, text, collapse = "<br>")
}




fileConn<-file("remind.html")
writeLines(c(text2), fileConn)
close(fileConn)


