R/twilio_message.R

Defines functions twilio_message print.twilio_message

twilio_message <- function(parsed_message){
  parsed_message$account_sid <- NULL
  parsed_message$messaging_service_sid <- NULL
  parsed_message$uri <- NULL
  parsed_message$subresource_uris <- NULL

  structure(
    parsed_message,
    class = "twilio_message"
  )
}

#' @export
print.twilio_message <- function(x, ...){
  cat("From: ", x$from, "\n",
      "To: ", x$to, "\n",
      "Body: ", x$body, "\n",
      "Status: ", x$status, sep = "")
  invisible(x)
}

Try the twilio package in your browser

Any scripts or data that you put into this service are public.

twilio documentation built on May 2, 2019, 10:58 a.m.