Package 'emailjsr'

Title: 'emailjs' Support for R
Description: Use 'emailjs' API easily in R. This package is not official. <https://www.emailjs.com/docs/rest-api/send/>.
Authors: Changwoo Lim [aut, cre]
Maintainer: Changwoo Lim <[email protected]>
License: MIT + file LICENSE
Version: 0.0.2
Built: 2024-10-29 04:46:43 UTC
Source: https://github.com/changwoolim/emailjsr

Help Index


send_email

Description

Send email using emailjs service.

Usage

send_email(
  service_id,
  user_id,
  template_id,
  template_params = list(),
  access_token = NULL
)

Arguments

service_id

emailjs.com Service Id

user_id

emailjs.com User Id or Public Key

template_id

emailjs.com Template Id

template_params

Params passed to emailjs.com. You should set template at emailjs.com in prior.

access_token

emailjs.com Access Token or Private Key. Default is NULL in case of you don't use access token.

Note

You should allow EmailJS API for non-browser applications.

Examples

library(emailjsr)

send_email("service_id", "user_id", "template_id", "access_token", list(name = "John Doe"))

use_emailjsr_server

Description

emailjs.com R support with preset modal

Usage

use_emailjsr_server(
  id,
  service_id,
  user_id,
  template_id,
  access_token,
  language = "en"
)

Arguments

id

Should be same to id of use_emailjsr_ui

service_id

emailjs.com Service Id

user_id

emailjs.com User Id

template_id

emailjs.com Template Id

access_token

emailjs.com Access Token

language

Language of modal. "en" for English, and "ko" for Korean.

Examples

library(shiny)
library(emailjsr)
ui <- fluidPage(
  use_emailjsr_ui("id")
)

server <- function(input, output, session) {
  emailjsr::use_emailjsr_server("id",
    service_id = "Your_service_id",
    template_id = "Your_template_id",
    user_id = "Your_user_id",
    access_token = "Your_Access_Token",
    language = "en"
  )
}

use_emailjsr_ui

Description

emailjs.com R support with preset modal

Usage

use_emailjsr_ui(id, message = "Show feedback modal")

Arguments

id

Should be same to id of use_emailjsr_server.

message

Messege on button.

Examples

library(shiny)
library(emailjsr)
ui <- fluidPage(
  use_emailjsr_ui("id")
)

server <- function(input, output, session) {
  emailjsr::use_emailjsr_server("id",
    service_id = "Your_service_id",
    template_id = "Your_template_id", user_id = "Your_user_id",
    access_token = "Your_Access_Token"
  )
}