-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
84 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,16 +9,29 @@ | |
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) | ||
[![test-coverage](https://github.com/mrchypark/sendgridr/workflows/test-coverage/badge.svg)](https://github.com/mrchypark/sendgridr/actions) | ||
[![CRAN | ||
status](https://www.r-pkg.org/badges/version/sendgridr)](https://CRAN.R-project.org/package=sendgridr) | ||
[![metacran | ||
downloads](https://cranlogs.r-pkg.org/badges/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 | ||
|
||
You can install the released version of sendgridr from CRAN with: | ||
|
||
install.packages("sendgridr") | ||
|
||
### Github | ||
|
||
You can install the developing version of sendgridr from | ||
[Github](https://github.com/mrchypark/sendgridr) with: | ||
|
||
# install.packages("remotes") | ||
remotes::install_github("mrchypark/sendgridr") | ||
|
||
## Set API key for authentication | ||
|
@@ -57,11 +70,20 @@ sendproject1 <- mail() | |
class(sendproject1) | ||
#> [1] "sg_mail" "list" | ||
sendproject1 | ||
#> SendGrid Mail - | ||
#> ✖ to : (required) | ||
#> ✖ from : (required) | ||
#> ✖ subject: (required) | ||
#> ✖ content: (required) | ||
#> $personalizations | ||
#> list() | ||
#> | ||
#> $from | ||
#> [1] "" | ||
#> | ||
#> $subject | ||
#> [1] "" | ||
#> | ||
#> $content | ||
#> list() | ||
#> | ||
#> attr(,"class") | ||
#> [1] "sg_mail" "list" | ||
``` | ||
|
||
![](https://user-images.githubusercontent.com/6179259/46489370-23453380-c840-11e8-9ca6-7758a92c6e92.png) | ||
|
@@ -80,11 +102,51 @@ mail() %>% | |
to("[email protected]", "3 exam") %>% | ||
subject("test mail title") %>% | ||
body("hello world!") | ||
#> SendGrid Mail - | ||
#> ✔ to : cnt[3] 1 exam <[email protected]>, 2 exam <to ... | ||
#> ✔ from : [email protected] <[email protected]> | ||
#> ✔ subject: nchr[15] test mail title | ||
#> ✔ content: nchr[12] hello world! | ||
#> $personalizations | ||
#> $personalizations$to | ||
#> $personalizations$to[[1]] | ||
#> $personalizations$to[[1]]$email | ||
#> [x] "[email protected]" | ||
#> | ||
#> $personalizations$to[[1]]$name | ||
#> [x] "1 exam" | ||
#> | ||
#> | ||
#> $personalizations$to[[2]] | ||
#> $personalizations$to[[2]]$email | ||
#> [x] "[email protected]" | ||
#> | ||
#> $personalizations$to[[2]]$name | ||
#> [x] "2 exam" | ||
#> | ||
#> | ||
#> $personalizations$to[[3]] | ||
#> $personalizations$to[[3]]$email | ||
#> [x] "[email protected]" | ||
#> | ||
#> $personalizations$to[[3]]$name | ||
#> [x] "3 exam" | ||
#> | ||
#> | ||
#> | ||
#> | ||
#> $from | ||
#> $from$email | ||
#> [x] "[email protected]" | ||
#> | ||
#> $from$name | ||
#> [x] "[email protected]" | ||
#> | ||
#> | ||
#> $subject | ||
#> [x] "test mail title" | ||
#> | ||
#> $content | ||
#> type value | ||
#> 1 text/html hello world! | ||
#> | ||
#> attr(,"class") | ||
#> [1] "sg_mail" "list" | ||
``` | ||
|
||
## TODO | ||
|