Science Score: 26.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (16.2%) to scientific vocabulary
Keywords
Keywords from Contributors
Repository
Easily send great-looking HTML email messages from R
Basic Info
- Host: GitHub
- Owner: rstudio
- License: other
- Language: R
- Default Branch: master
- Homepage: https://pkgs.rstudio.com/blastula
- Size: 44.7 MB
Statistics
- Stars: 559
- Watchers: 20
- Forks: 85
- Open Issues: 106
- Releases: 10
Topics
Metadata Files
README.md
The blastula package makes it easy to produce and send HTML email from R. The message can have three content areas (the body, the header, and the footer) and we can insert Markdown text, block-based components, and even HTML fragments. The underlying HTML/CSS is meant to display properly across a wide range of email clients and webmail services. The resulting email message is responsive so it’ll look great on both large displays and mobile devices.
Composing an Email Message
When you compose an email, you can use objects from the global workspace and work them into the message content. Let’s create a nicely formatted date/time string (date_time) with the add_readable_time() function, and, transform an image on disk to an HTML string object (img_string).
```r
Get a nicely formatted date/time string
datetime <- addreadable_time()
Create an image string using an on-disk
image file
imgfilepath <- system.file( "img", "pexels-photo-267151.jpeg", package = "blastula" )
imgstring <- addimage(file = imgfilepath) ```
Now we use the compose_email() function to compose the email. There are three main arguments here: body, header, and footer. You can supply Markdown text to any of these content areas to get rendered HTML.
In the example code below, the strings that are part of the email body and the email footer are combined with glue::glue() and, since we have Markdown and HTML fragments, we need to use the md() function.
```r email <- compose_email( body = md(glue::glue( "Hello,
This is a great picture I found when looking for sun + cloud photos:
{imgstring} ")), footer = md(glue::glue("Email sent on {datetime}.")) ) ```
After creating the email message, we can look at it to ensure that the formatting is as expected. Simply call the object itself and it will be displayed in the Viewer.
```r
Preview the email
email ```

Sending an Email Message via SMTP
We can store SMTP email credentials in a file using the create_smtp_creds_file() function. There are also other ways to set up SMTP access credentials (like using system-wide key-value store through the create_smtp_creds_key() function).
Having generated a credentials file, we can use the smtp_send() function (along with the creds_file() credentials helper function) to send the email through an SMTP server.
```r
Sending email by SMTP using a credentials file
email |>
smtpsend(
to = "janedoe@example.com",
from = "joepublic@example.net",
subject = "Testing the `smtpsend()function",
credentials = creds_file("email_creds")
)
``
Sending Email Messages through Posit Connect
We can also send email based on R Markdown files through Posit Connect. The prepare_rsc_example_files() function provides .Rmd files that facilitate a main report + email report workflow. The key components are the blastula::blastula_email output type for the email report, and the use of render_connect_email() and attach_connect_email() in the main report.
Installation
Want to try this out? The blastula package is available on CRAN:
r
install.packages("blastula")
You can also install the development version of blastula from GitHub:
r
devtools::install_github("rstudio/blastula")
If you encounter a bug, have usage questions, or want to share ideas to make this package better, feel free to file an issue.
Code of Conduct
Please note that the rstudio/blastula project is released with a contributor code of conduct.
By participating in this project you agree to abide by its terms.
📄 License
blastula is licensed under the MIT license. See the LICENSE.md file for more details.
© Posit Software, PBC.
🏛️ Governance
This project is primarily maintained by Richard Iannone. Should there also be other authors, they might occasionally assist with some of these duties.
Owner
- Name: RStudio
- Login: rstudio
- Kind: organization
- Email: info@rstudio.org
- Location: Boston, MA
- Website: http://rstudio.org
- Repositories: 356
- Profile: https://github.com/rstudio
GitHub Events
Total
- Issues event: 9
- Watch event: 17
- Delete event: 1
- Issue comment event: 18
- Push event: 9
- Pull request event: 2
- Fork event: 1
- Create event: 1
Last Year
- Issues event: 9
- Watch event: 17
- Delete event: 1
- Issue comment event: 18
- Push event: 9
- Pull request event: 2
- Fork event: 1
- Create event: 1
Committers
Last synced: 11 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| Richard Iannone | r****e@m****m | 1,109 |
| Joe Cheng | j****e@r****m | 31 |
| Neal Richardson | n****n@g****m | 2 |
| Vincent C Fulco | v****1@g****m | 2 |
| Adam T Austin | a****n@g****m | 1 |
| Alison Presmanes Hill | a****n@r****m | 1 |
| Alternikaner | A****r | 1 |
| Andy Merlino | a****o@t****m | 1 |
| Angela | 5****i | 1 |
| Aron Atkins | a****n@p****o | 1 |
| Emily Riederer | e****r@g****m | 1 |
| François Michonneau | f****u@g****m | 1 |
| Gus Lipkin | g****n@g****m | 1 |
| Jacqueline Nolis | j****s | 1 |
| Jon Calder | j****r@g****m | 1 |
| Salim B | s****m@p****e | 1 |
| Xianying Tan | s****n@1****m | 1 |
| olivroy | 5****y | 1 |
| pabecer | p****r@g****m | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 87
- Total pull requests: 33
- Average time to close issues: 7 months
- Average time to close pull requests: 8 months
- Total issue authors: 80
- Total pull request authors: 16
- Average comments per issue: 1.93
- Average comments per pull request: 0.64
- Merged pull requests: 23
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 7
- Pull requests: 2
- Average time to close issues: 20 days
- Average time to close pull requests: about 17 hours
- Issue authors: 7
- Pull request authors: 1
- Average comments per issue: 0.14
- Average comments per pull request: 0.0
- Merged pull requests: 2
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- rich-iannone (6)
- chuxinyuan (2)
- algo-se (2)
- BlueyCoder (1)
- kmasiello (1)
- leungi (1)
- caldwellst (1)
- j450h1 (1)
- jorgesinval (1)
- asadow (1)
- TenshiChiyo (1)
- Leprechault (1)
- wfmackey (1)
- ScaonE (1)
- agronomofiorentini (1)
Pull Request Authors
- rich-iannone (16)
- nealrichardson (3)
- shrektan (2)
- aronatkins (2)
- ASBecker (2)
- pabecer (2)
- cderv (2)
- wkmor1 (1)
- apreshill (1)
- guslipkin (1)
- jnolis (1)
- dave-lanigan (1)
- jeroen (1)
- ataustin (1)
- aalucaci (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 2
-
Total downloads:
- cran 7,190 last-month
- Total docker downloads: 53,342
-
Total dependent packages: 3
(may contain duplicates) -
Total dependent repositories: 18
(may contain duplicates) - Total versions: 19
- Total maintainers: 1
proxy.golang.org: github.com/rstudio/blastula
- Documentation: https://pkg.go.dev/github.com/rstudio/blastula#section-documentation
- License: other
-
Latest release: v0.3.6
published 11 months ago
Rankings
cran.r-project.org: blastula
Easily Send HTML Email Messages
- Homepage: https://github.com/rstudio/blastula
- Documentation: http://cran.r-project.org/web/packages/blastula/blastula.pdf
- License: MIT + file LICENSE
-
Latest release: 0.3.6
published 11 months ago
Rankings
Maintainers (1)
Dependencies
- R >= 3.2.1 depends
- base64enc >= 0.1 imports
- commonmark >= 1.7 imports
- curl >= 4.3 imports
- digest * imports
- dplyr >= 0.8.3 imports
- fs >= 1.3.1 imports
- getPass >= 0.2 imports
- here >= 0.1 imports
- htmltools >= 0.4.0 imports
- httr >= 1.4.0 imports
- jsonlite >= 1.6 imports
- magrittr >= 1.5 imports
- mime >= 0.6 imports
- rlang >= 0.4.1 imports
- rmarkdown * imports
- stringr >= 1.4.0 imports
- uuid >= 0.1 imports
- covr * suggests
- ggplot2 * suggests
- glue * suggests
- keyring * suggests
- knitr * suggests
- spelling * suggests
- testthat >= 3.0.0 suggests
- xml2 * suggests
- actions/checkout v2 composite
- r-lib/actions/check-r-package v2 composite
- r-lib/actions/setup-pandoc v2 composite
- r-lib/actions/setup-r v2 composite
- r-lib/actions/setup-r-dependencies v2 composite
- actions/cache v2 composite
- actions/checkout v2 composite
- nwtgck/actions-netlify v1.1 composite
- r-lib/actions/setup-pandoc v1 composite
- r-lib/actions/setup-r v1 composite