'SendGrid' Email API Client

Simple 'SendGrid' Email API client for creating and sending emails. For more information, visit the official 'SendGrid' Email API documentation: < https://sendgrid.com/en-us/solutions/email-api>.


sg

Lifecycle:experimental CRANstatus

Simple SendGrid Email API client for sending emails with R.

Installation

Install the released version of sg from CRAN:

install.packages("sg")

Or install the development version from GitHub with:

# install.packages("pak")
pak::pak("botan/sg")

Authentication

Set your API key using the SENDGRID_API_KEY environment variable. The package will automatically detect and use it when sending emails.

Usage

This is a basic example which shows you how to send an email:

library(sg)

sg_mime() |>
  sg_from("[email protected]") |>
  sg_to("[email protected]", "[email protected]") |>
  sg_cc("[email protected]", "[email protected]") |>
  sg_bcc("[email protected]", "[email protected]") |>
  sg_subject("This is the subject") |>
  sg_body("Hello from sg!") |>
  sg_attachments("path/to/file1.csv", "path/to/file2.pdf") |>
  sg_send()

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("sg")

0.2.0 by Botan Ağın, 2 years ago


https://github.com/botan/sg, https://botan.github.io/sg/


Report a bug at https://github.com/botan/sg/issues


Browse source code at https://github.com/cran/sg


Authors: Botan Ağın [aut, cre]


Documentation:   PDF Manual  


MIT + file LICENSE license


Imports base64enc, httr2, mime, rlang


See at CRAN