reminders.R 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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 and each researcher on the sfb1315-output.de website.
  29. It would be more efficient 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. For the personal pages, I need you to get and update your orcid profile (see https://www.sfb1315-output.de/post/using-orcid/).
  32. Best regards and stay safe,
  33. "
  34. text =paste0("<a href='mailto:", emails,
  35. "?subject=making SFB1315-output.de awesome&body=Dear members of project ",group,",", gsub('&NewLine;','%0D%0A',textutils::HTMLencode(text_mail))
  36. ," '> ",
  37. group," </a>")
  38. text2 = paste0 (text2, text, sep = "<br>")
  39. }
  40. fileConn<-file("remind.html")
  41. writeLines(c(text2), fileConn)
  42. close(fileConn)