R and Shiny - Alerts



Hi All,

i have created a churn prediction model using R and deployed it in shiny(free version). when i pass in the input parameters, i get the output as churn/Non churn.

My question is, whenever i get output as churn, an email/sms has to be sent to a particular mail id. is it possible to do this? if possible pls list down the steps and combination
of technology to be used.



Guys, Any solution/updates on this?


There are two packages in R 1. sendmailR and 2. mailR with help of it you can send email to users…



I think this article from listendata.com will surely help you

you can put a trigger or reactive function to send the email when one of the tab is selected.


Hey, @Rajaram1986.

You can simply try mailR package. Consider this for example :

send.mail(from = "sender@gmail.com",
          to = c("recipient1@gmail.com", "recipient2@gmail.com"),
          subject = "Subject of the email",
          body = "Body of the email",
          smtp = list(host.name = "smtp.gmail.com", port = 465, user.name = "gmail_username", passwd = "password", ssl = TRUE),
          authenticate = TRUE,
          send = TRUE,
          attach.files = c("./download.log", "upload.log", "https://dl.dropboxusercontent.com/u/5031586/How%20to%20use%20the%20Public%20folder.rtf"),
          file.names = c("Download log.log", "Upload log.log", "DropBox File.rtf"), # optional parameter
          file.descriptions = c("Description for download log", "Description for upload log", "DropBox File"), # optional parameter
          debug = TRUE) 

You can call send.mail() function by creating a simple if statement on server side if your churn outcome is true.

Hope this helps. :slight_smile: