Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mrchypark/sendgridr
Mail Sender Using SendGrid mail API
https://github.com/mrchypark/sendgridr
hacktoberfest hacktoberfest2021 mail mailer package r sendgrid
Last synced: 3 months ago
JSON representation
Mail Sender Using SendGrid mail API
- Host: GitHub
- URL: https://github.com/mrchypark/sendgridr
- Owner: mrchypark
- License: other
- Created: 2018-09-19T07:48:20.000Z (about 6 years ago)
- Default Branch: main
- Last Pushed: 2024-02-13T23:56:55.000Z (9 months ago)
- Last Synced: 2024-04-14T07:11:05.134Z (7 months ago)
- Topics: hacktoberfest, hacktoberfest2021, mail, mailer, package, r, sendgrid
- Language: R
- Homepage: https://mrchypark.github.io/sendgridr/
- Size: 5.42 MB
- Stars: 23
- Watchers: 3
- Forks: 6
- Open Issues: 6
-
Metadata Files:
- Readme: README.Rmd
- Contributing: .github/CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: .github/CODE_OF_CONDUCT.md
- Support: .github/SUPPORT.md
Awesome Lists containing this project
- awesome-shiny-extensions - sendgridr - Send emails with SendGrid mail API (v3). (Backend / Notification Integration)
- jimsghstars - mrchypark/sendgridr - Mail Sender Using SendGrid mail API (R)
README
---
output: github_document
---```{r setup, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
library(sendgridr)
```# sendgridr
[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental)
[![R-CMD-check](https://github.com/mrchypark/sendgridr/workflows/R-CMD-check/badge.svg)](https://github.com/mrchypark/sendgridr/actions)
[![send-test](https://github.com/mrchypark/sendgridr/actions/workflows/send-test.yaml/badge.svg)](https://github.com/mrchypark/sendgridr/actions/workflows/send-test.yaml)
[![CRAN status](https://www.r-pkg.org/badges/version/sendgridr)](https://CRAN.R-project.org/package=sendgridr)
[![runiverse-name](https://mrchypark.r-universe.dev/badges/:name)](https://mrchypark.r-universe.dev/)
[![runiverse-package](https://mrchypark.r-universe.dev/badges/sendgridr)](https://mrchypark.r-universe.dev/packages)
[![metacran downloads](https://cranlogs.r-pkg.org/badges/sendgridr)](https://cran.r-project.org/package=sendgridr)
[![Downloads](https://cranlogs.r-pkg.org/badges/grand-total/sendgridr)](https://CRAN.R-project.org/package=sendgridr)The goal of sendgridr is to mail using r with sendgrid service that provides free 100 mail per day forever.
## Installation
```
# CRAN version
install.packages("sendgridr")# Dev version
install.packages("sendgridr", repos = "https://mrchypark.r-universe.dev")
```## Set API key for authentication
You can set api key using `auth_set()` function.
Also `auth_check()` function check api key works.```
auth_check()
auth_set()
```## Send mail
### Example code
Please replace your conditions.
```
mail() |>
from("[email protected]", "example name for display") |>
to("[email protected]", "example name for display 2") |>
subject("test mail title") |>
body("hello world!") |>
## attachments is optional
attachments("report.html") |>
send()
```### sg_mail class
`mail()` function create sg_mail class object and also list.
sg_mail class only has print method.```{r}
sendproject1 <- mail()
class(sendproject1)
sendproject1
```to, from, subject, body are required. cc, bcc, attachments are optional.
### multi- setting using inline
to, cc, bcc, attachments functions are able to set multi values.
```{r}
library(sendgridr)
mail() |>
from("[email protected]", "[email protected]") |>
to("[email protected]", "1 exam") |>
to("[email protected]", "2 exam") |>
to("[email protected]", "3 exam") |>
subject("test mail title") |>
body("hello world!")
```## Code of Conduct
Please note that the sendgridr project is released with a [Contributor Code of Conduct](https://mrchypark.github.io/sendgridr/CODE_OF_CONDUCT.html). By contributing to this project, you agree to abide by its terms.