reminders.R 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #email reminder app
  2. #1 survey analysis
  3. #read google doc
  4. library (googlesheets)
  5. gs_auth()
  6. PIlist = gs_url ("https://docs.google.com/spreadsheets/d/1jVBj0RBZ4zFwtL1dcy-D9UA_QRvkGhX8s5_sWI8toEk/edit#gid=390395480")
  7. data= googlesheets::gs_read_csv(PIlist, skip =2)
  8. remind = data[data$`Data Survey`== "0",]
  9. text2= ""
  10. for (i in c(1:15)) {
  11. text =paste0("<a href='mailto:", remind$Email[i], "?subject=SFB1315-data&body=Dear Prof. ",remind$`Last name`[i],", '> ",i,remind$`Last name`[i]," </a>")
  12. text2 = paste0 (text2, text, collapse = "<br>")
  13. }
  14. fileConn<-file("remind.html")
  15. writeLines(c(text2), fileConn)
  16. close(fileConn)
  17. # 2 image and orcid
  18. peoplelist <- read_delim("~/Documents/Seafile/SFB1315info/allpeople.csv",
  19. "\t", escape_double = FALSE, trim_ws = TRUE)
  20. peoplelist_sub = peoplelist[!is.na(peoplelist$SFBgroup),]
  21. groups = unique(peoplelist_sub$SFBgroup)
  22. text2 = ""
  23. for (group in groups){
  24. #group = "Z"
  25. peoplelist_group <- peoplelist_sub[peoplelist_sub$SFBgroup == group,]
  26. emails = paste0(peoplelist_group$email, collapse = ",")
  27. text_mail = "
  28. As explained in my previous email, we want to present each project on the sfb1315-output.de website.
  29. I think it would be good if you could indicate one person of contact for the creation of the project page, so that my future emails do not go to all of you.
  30. Note that if you have no time to create a figure with Thomas Splettstoesser before the website launch, we will need to use another image as a thumbnail.
  31. Best regards,
  32. "
  33. text =paste0("<a href='mailto:", emails,
  34. "?subject=SFB1315-output.de&body=Dear members of project ",group,",", gsub('&NewLine;','%0D%0A',textutils::HTMLencode(text_mail))
  35. ," '> ",
  36. group," </a>")
  37. text2 = paste0 (text2, text, sep = "<br>")
  38. }
  39. fileConn<-file("remind.html")
  40. writeLines(c(text2), fileConn)
  41. close(fileConn)