-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
README.Rmd
101 lines (75 loc) · 2.98 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r setup, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
library(sendgridr)
```
# sendgridr <img src="man/figures/logo.png" align="right" height=140/>
<!-- badges: start -->
[![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)
<!-- badges: end -->
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.