Git Product home page Git Product logo

blastula's Introduction


CRAN status License: MIT R build status Coverage status

The project has reached a stable, usable state and is being actively developed. Monthly Downloads Total Downloads

Contributor Covenant

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).

# Get a nicely formatted date/time string
date_time <- add_readable_time()

# Create an image string using an on-disk
# image file
img_file_path <-
  system.file(
    "img", "pexels-photo-267151.jpeg",
    package = "blastula"
  )

img_string <- add_image(file = img_file_path)

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.

email <-
  compose_email(
    body = md(glue::glue(
"Hello,

This is a *great* picture I found when looking
for sun + cloud photos:

{img_string}
")),
    footer = md(glue::glue("Email sent on {date_time}."))
  )

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.

# 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.

# Sending email by SMTP using a credentials file
email |>
  smtp_send(
    to = "[email protected]",
    from = "[email protected]",
    subject = "Testing the `smtp_send()` 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:

install.packages("blastula")

You can also install the development version of blastula from GitHub:

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.

blastula's People

Contributors

aalucaci avatar alternikaner avatar apreshill avatar aronatkins avatar ataustin avatar emilyriederer avatar fmichonneau avatar guslipkin avatar jcheng5 avatar jnolis avatar jonmcalder avatar merlinoa avatar nealrichardson avatar olivroy avatar pabecer avatar rich-iannone avatar salim-b avatar shrektan avatar vfulco avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

blastula's Issues

evaluation of local variables needs .envir

Given the following R script:

library(blastula)

doit <- function() {
  importantPerson <- "Bob"
  message <- blastula::compose_email(
    'you are quite important, {importantPerson}'
  )
  body_html <- blastula::get_html_str(message)
  body_html
}

doit()

Running with Rscript minimal.R produces an evaluation error:

Error in eval(parse(text = code, keep.source = FALSE), envir) :
  object 'importantPerson' not found
Calls: doit ... glue_data -> <Anonymous> -> .transformer -> eval -> eval
Execution halted

There are two workarounds:

  1. Move the definition of importantPerson to the global environment.
  2. Add the argument .envir = new.env() to the compose_email arguments.

This latter workaround feels like it should be the default; instructing glue::glue to use the calling environment when evaluating template strings.

This same issue is encountered when embedding blastula rendering within an R Markdown document:

---
title: this email is so custom
---
```{r}
library(blastula)
importantPerson <- "Bob"
message <- blastula::compose_email(
  'you are quite important, {importantPerson}'
)
body_html <- blastula::get_html_str(message)
body_html
```

Revise README

The current README is overlong and doesn't present well.

HTML tag appears randomly in html table

Hello,

I am having issue when tag < td style="text-align:left;"> is showing up randomly in html table inside mail body sent by blastula compose_email function. Here is the example:
image

Maybe you have some ideas how can I troubleshoot this further?

text wrapping/image resizing in Google Inbox

Viewing the blastula email you just sent about DiagrammeR revdeps in Google Inbox online, on my laptop (and in Boxy, the client I use), the header image wasn't resized, and long lines of text weren't wrapped (a horizontal scroll bar appeared instead):
screen shot 2017-08-21 at 10 50 57 am
screen shot 2017-08-21 at 10 51 09 am

I suspect this is due to the HTML environments that were used. Maybe something like span would make it look nicer?

It looks great on the android Inbox app though.

Not sure show how to make this reproducible, but happy to test out solutions if you want to email them to me!

attach_dispositions are ignored

Call to send_email_out with attach_dispositions argument supplied do not generate correct command line for mailsend:

send_email_out(
  message = ml,
  from = "[email protected]",
  to = "[email protected]",
  subject = "Test mail",
  creds_file = ".email_test",
  sender = "Test",
  attachments = c("/home/ruser/somedir/temp.html"),
  attach_dispositions = c("attachment","attachment"),
  verbose = T,
  debug=T
)

Mailsend command generated as follow:

/home/ruser/somedir/mailsend -from "[email protected]" -name "Test" -t "[email protected]" +cc +bc -sub "Test mail" -ssl   -smtp smtp.gmail.com -port 465 -auth -user [email protected] -pass "hashedpasswordhere" -v -mime-type "text/html" -enc-type "us-ascii" -disposition "inline" -attach "message_inlined.html" -attach /home/ruser/somedir/temp.html

As we see for the attachment temp.html flag -disposition "attachment" was not generated and thus this attachment use previously supplied flag related to message body. This is incorrect.

Setting custom port seems to fail

When setting a port other than 465, sending email fails, and the error message seems to imply Blastula attempted to use port 465 rather than the specified port.

I tried with both my private mail server and outlook.com

`Sys.setenv(bls_sender = "[email protected]",
bls_host = "smtp-mail.outlook.com",
bls_username = "[email protected]",
bls_password = "*********",
bls_port = 587)

send_email_out(
message = email_object,
from = "[email protected]",
recipients = "[email protected]",
subject = "Test mail.",
sender = Sys.getenv("bls_sender"),
host = Sys.getenv("bls_host"),
port = Sys.getenv("bls_port"),
user = Sys.getenv("bls_username"),
password = Sys.getenv("bls_password"))`

And the resulting error:

org.apache.commons.mail.EmailException: Sending the email to the following server failed : smtp-mail.outlook.com:465 at org.apache.commons.mail.Email.sendMimeMessage(Email.java:1410) at org.apache.commons.mail.Email.send(Email.java:1437) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at RJavaTools.invokeMethod(RJavaTools.java:386) Caused by: com.sun.mail.util.MailConnectException: Couldn't connect to host, port: smtp-mail.outlook.com, 465; timeout 60000; nested exception is: java.net.ConnectException: Connection timed out: connect at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:2053) at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:697) at javax.mail.Service.connect(Service.java:386) at javax.mail.Service.connect(Service.java:245) at javax.mail.Service.connect(Service.java:194) at javax.mail.Transport.send0(Transport.java:253) at javax.mail.Transport.send(Transport.java:124) at org.apache.commons.mail.Email.sendMimeMessage(Email.java:1400) ... 6 more Caused by: java.net.ConnectException: Connection timed out: connect at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method) at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source) at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source) at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source) at java.net.AbstractPlainSocketImpl.connect(Unknown Source) at java.net.PlainSocketImpl.connect(Unknown Source) at java.net.SocksSocketImpl.connect(Unknown Source) at java.net.Socket.connect(Unknown Source) at sun.security.ssl.SSLSocketImpl.connect(Unknown Source) at com.sun.mail.util.SocketFetcher.createSocket(SocketFetcher.java:310) at com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:215) at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:2019) ... 13 more NULL Error: EmailException (Java): Sending the email to the following server failed : smtp-mail.outlook.com:465

Socket Error: [35]: Resource temporarily unavailable (Mac OS) or Socket Error: [11]: Resource temporarily unavailable (Linux)

I keep running into the following error:
Socket Error: [35]: Resource temporarily unavailable
or
Socket Error: [11]: Resource temporarily unavailable
on Mac OS and Linux, respectively.

Here's my code using the office365 provider:

blastula::create_email_creds_file(user = "user name",
                                    password = "password",
                                    provider = "office365",
                                    sender="My Name",
                                    creds_file_name = "~/Downloads/email_creds")

email_body <- 
  blastula::compose_email(
    body="## This is a test email
    Nothing special to see here.", footer="This is a footer")

blastula::send_email_out(message=email_body,
                         from="[email protected]",
                         to="[email protected]",
                         subject="Test email",
                         creds_file="~/Downloads/email_creds",
                         verbose=TRUE)

I've also tried manually configuring the SMTP settings:

blastula::send_email_out(message=email_body,
                         from="[email protected]",
                         to="[email protected]",
                         subject="Test email",
                         host	= "smtp.office365.com",
                         port	= 587,
                         user	= "user name",
                         password = "password",
                         use_ssl = FALSE,
                         use_tls = TRUE,
                         authenticate = TRUE,
                         verbose=TRUE)

Here's the full RStudio console output:

> libmsock: using getaddrinfo
> AF_INET IPv4
 IPv4 address: 52.96.3.130
> EINPROGRESS=36,EWOULDBLOCK=35
> connect(): socket=7,rc=-1, errno=36
> Try socket 7
> Setting read timeout to: 5 seconds
> Setting read timeout to: 5 seconds
> Setting read timeout to: 5 seconds
> Setting read timeout to: 5 seconds
> Setting read timeout to: 5 seconds
> Setting read timeout to: 5 seconds
> Setting read timeout to: 5 seconds
> Setting read timeout to: 5 seconds
> Setting read timeout to: 5 seconds
> Setting read timeout to: 5 seconds
> Setting read timeout to: 5 seconds
> Setting read timeout to: 5 seconds
Socket Error: [35]: Resource temporarily unavailable
Error: Connection is closed unexpectedly
Error: AUTH LOGIN failed: '-1 '
[1] TRUE
Warning message:
In system(command = command, intern = TRUE) :
  running command '/Users/Chris/r/propeller/mailsend -from "[email protected]" -name "My Name" -t "[email protected]" +cc +bc -sub "Test email"  -starttls  -smtp smtp.office365.com -port 587 -auth -user user_name -pass "password" -v -mime-type "text/html" -enc-type "us-ascii" -disposition "inline" -attach "message_inlined.html" ' had status 1

What am I doing wrong here?

Better print method for the email object

This should automatically show the email content in the Viewer (no need to use preview_email()) and should stop showing the bare list object. Suppress console output, until perhaps we can show something that is informational.

Adding images works in preview but not in actual email

Hi! Awesome package you've put together!

I am using the add_image() option to generate an image-rich email but while working in the preview mode, when sending it the image is encoded

ggsave(filename = 'perf.jpeg', plot = perf,path = './Images',device = 'jpeg')

# Create an HTML fragment that
# contains an image
img_file_html <-
  add_image(
    file = './Images/perf.jpeg')

formatted_table <-
  format_table(
    x = df, 
    digits = 2,
    align = 'c')
 
email_object <-
  compose_email(
    body = "
Hello,

Here are the model performance summaries you've been hounding me \\
for all this past week. Overall, everyone did \\
quite well. I'm impressed.

<h3 style=\"text-align:left;\">Random Forest Performance</h3>

{formatted_table}
<br />

Take a look at this :
{img_file_html}
<br />
Cheers,<br />The modeler")

I am using Mailgun as the SMTP, fyi.

Unable to send emails through Office365

When attempting to send emails through Office365, using either POP, IMAP or SMTP settings, the following error message is returned in the console.

Error: EmailException (Java): Sending the email to the following server failed : smtp.office365.com:465

Port 465 is always attached to the end of the server, regardless of the value entered for the port argument of send_email_out.

Base64-encoded image URI's last character truncated

For debugging, I edited this file: https://github.com/rich-iannone/blastula/blob/master/R/add_image.R#L50

I add a line of code to save the knitr::image_uri output to a file in /tmp:

  # Create the image URI
  uri <- knitr::image_uri(f = file)
  write(uri, file = file.path("/tmp", cid))

Here is my example Rmd:

---
title: "New Data!"
author: "ccg"
date: "6/13/2018"
output: html_document
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```

## Stuff

```{r blastula-stuff}
library(blastula)
library(ggplot2)

# Create a ggplot plot object
car_plot <- 
  ggplot(
    data = mtcars,
    aes(
      x = disp, y = hp,
      color = wt, size = mpg)) +
  geom_point()

ggplot2::ggsave("plot.png",
                plot = car_plot,
                device = "png",
                width = 5, height = 5)

# Let's use the `add_ggplot()`
# helper function right inside the
# email message body this time
email <- compose_email(
  body = "
  New data is available!
  
  This plot summarizes the new data:
  
  {add_ggplot(plot_object = car_plot, width = 5, height = 5)}
  
  Cheers
  ")

cid <- names(email$images)[1]
cid
nchar(email$images[[cid]])
email$images
```

When I examine the file written to /tmp, I see iVBOR...Jggg== (length 26868, ending with the two == characters), but the output in the Rmd shows "iVBOR...Jggg=" (length 26867, ending with only one = character).

Email attachments in RSC-RMarkdown emailing

Currently, there is no way to specify email attachments for an email message produced in an RSC-RMarkdown process. We would need an attachments argument in either attach_email() or render_email() to express which files are attached to the RSC email message.

Also, it would be nice to programmatically express email attachments. Files can come from various locations (e.g., already available in RSC, produced as part of .Rmd render process, local files on user's system, etc.). It would be useful to have a function (not part of the blastula package) that allows users to search for files and return a vector of matches (which could be part of the input for the attachments arg).

cc: @slopp

send_email_out not working in development version

Hello @rich-iannone,

I recently tried upgrading to the development version in order to be able to send attachments but after doing so I am receiving an error on the send_email_out function.

It says:

Error in system(command = command, intern = TRUE) :
'F:/OneDrive' not found

This was previously working for another script that sent an email without an attachment but that has broken as well. Please let me know if there is anything I can provide to assist.

Here is my session info.

`R version 3.4.2 (2017-09-28)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.1252
[2] LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C
[5] LC_TIME=English_United States.1252

attached base packages:
[1] stats graphics grDevices utils datasets methods
[7] base

other attached packages:
[1] bindrcpp_0.2 dygraphs_1.1.1.4 formattable_0.2.0.1
[4] kableExtra_0.6.1 DBI_0.7 qualtRics_2.2
[7] httr_1.3.1 jsonlite_1.5 blastula_0.2
[10] forcats_0.2.0 stringr_1.2.0 dplyr_0.7.4
[13] purrr_0.2.4 readr_1.1.1 tidyr_0.7.2
[16] tibble_1.3.4 ggplot2_2.2.1 tidyverse_1.2.1
[19] RevoUtilsMath_10.0.1

loaded via a namespace (and not attached):
[1] bit64_0.9-7 viridisLite_0.2.0 modelr_0.1.1
[4] assertthat_0.2.0 highr_0.6 blob_1.1.0
[7] cellranger_1.1.0 yaml_2.1.15 backports_1.1.1
[10] lattice_0.20-35 glue_1.2.0 downloader_0.4
[13] digest_0.6.12 rvest_0.3.2 snakecase_0.5.1
[16] colorspace_1.3-2 htmltools_0.3.6 plyr_1.8.4
[19] psych_1.7.8 pkgconfig_2.0.1 broom_0.4.3
[22] haven_1.1.0 scales_0.5.0.9000 sjlabelled_1.0.5
[25] lazyeval_0.2.1 cli_1.0.0 mnormt_1.5-5
[28] magrittr_1.5 crayon_1.3.4 readxl_1.0.0
[31] evaluate_0.10.1 nlme_3.1-131 xml2_1.1.1
[34] foreign_0.8-69 tools_3.4.2 hms_0.4.0
[37] odbc_1.1.3 munsell_0.4.3 prediction_0.2.0
[40] compiler_3.4.2 rlang_0.1.4 grid_3.4.2
[43] rstudioapi_0.7 htmlwidgets_0.9 base64enc_0.1-3
[46] rmarkdown_1.8 gtable_0.2.0 curl_3.0
[49] reshape2_1.4.2 R6_2.2.2 zoo_1.8-0
[52] lubridate_1.7.1 knitr_1.17 bit_1.1-12
[55] bindr_0.1 commonmark_1.4 rprojroot_1.2
[58] stringi_1.1.6 parallel_3.4.2 Rcpp_0.12.14
[61] RevoUtils_10.0.6 dbplyr_1.1.0 tidyselect_0.2.3 `

smtp_send Error in process_initialize Command Not Found

Hi Rich,
I'm trying to use smtp_send() with the new mail-send-go. I copied both the mailsend-go-dir/mailsend-go.exe into my working directory and when I go to run the command and leave the binary_loc argument empty, I get the message "ERROR: Unknown option *@.org" (my from argument) . When I set the binary_loc as my working directory, I get the error message "Error in process_initialize(self, private, command, args, stdin, stdout, : Command not found."
Thank you!

E-mail is sent as "inline" attachment instead of regular mail body

Whenever I send an e-mail using blastula::smtp_send() the actual message is sent as an "inline attachment" which – at least in Thunderbird 60 with default settings – results in no (visual) text in the mail body unless you explicitly activate Display Attachments Inline.

In the code of smtp_send.R I see that mailsend-go's attach option is used with the -inline flag. I guess it would be better to use the body option instead (at least by default), so that all mail clients can properly display the message.

Or is there a specific reason why the attach option is used?


I'm using the latest dev version of blastula on Ubuntu Linux 16.04 with latest mailsend-go v1.0.4.

Use UTF-8 characters inside mail body

I am using windows 7 and R 3.5.1.

I would like to know is it possible to use UTF-8 characters in email body.
I tried this:

email <- compose_email(
  body = "
  Hello Mislav Šagovac",
  encoding = "UTF-8")

send_email_out(
  message = email,
  from = "[email protected]",
  to = "[email protected]",
  subject = "Testni mail",
  creds_file = ".e_creds"
  )

and this

test <- "Hello Mislav Šagovac"
Encoding(test) <- "UTF-8"
send_email_out(
  message = email,
  from = "[email protected]",
  to = "[email protected]",
  subject = "Testni mail",
  creds_file = ".e_creds"
  )

but any of above worked.

Htmlwidget support

This would be a pretty killer feature, embedding leaflet maps and the like into the body of the email!

Argument to add alt text to images

Thanks for the great package! I first got to use it last weekend and really enjoyed it, and I've been very excited watching new features flood in this week. I'm hoping to become a heavy user of this package and wanted to share an idea.

One feature I would appreciate is an optional alt argument in add_image() and add_imgur_image() which could pass a character string to the alt attribute of the <img> tag.

Potentially, this could also be used for add_ggplot() since that calls add_image() internally. Here, perhaps it could be exposed to users but the alt text could default to the plot title (if one exists)?

This might be useful for those with bad internet / email clients and make blastula emails more accessible to those using screen readers. While not universally supported, I did find some good tables in this article to suggest that many email clients support alt text.

If this sounds like a good idea, I'd be happy to make a PR if that would be helpful.

Thanks again for blastula!

libssl.so.35 not being found (symbolic link broken?)

Not terribly facile with inner guts of linux and symbolic links. Running daily build of Ubuntu 18.04 (bionic beaver) and latest R, R-studio, blastula and all packages.

/home/foo_user/foo_script/mailsend: error while loading shared libraries: libssl.so.35: cannot open shared object file: No such file or directory
Error in system(command = command, intern = TRUE) :
error in running command

libssl1.1 and *-dev are installed.

libssl-dev is already the newest version (1.1.0g-2ubuntu3).

Will post here if I solve.

Create pkgdown site

Move instructional content from README into vignettes and create pkgdown site where the vignettes are articles.

SMTP authentication issue with SendGrid

When trying to send with SendGrid via blastula:

send_email_out(
    message = email_object,
    from = <from>,
    to = <to>,
    subject = <subject>,
    sender = <sender>
    host = "smtp.sendgrid.net",
    port = 465,
    user =  <user>,
    password = <password>,
    use_ssl = TRUE,
    authenticate = TRUE
)

I get an authentication error:

Error: AUTH LOGIN failed: '535 Authentication failed: The provided authorization grant is invalid, expired, or revoked'

Initially I thought it was due to incorrect credentials for SendGrid's SMTP relay, but I have since verified repeatedly that the exact same details (host, port, user & password) work fine when trying with the mailR package:

library(mailR)

send.mail(
    from = <from>,
    to = <to>
    subject= <subject>,
    body = <body>,
    smtp = list(
        host.name = "smtp.sendgrid.net", 
        port = 465, 
        user.name= <user>, 
        passwd = <password>, 
        ssl = TRUE
    ),
    authenticate = TRUE,
    send = TRUE
)

What am I missing? Any idea what this could be?

send_email_out cannot find `mailsend`

Using Windows system through gmail. I can see the .bls_smtp_gmail_com and sendmail files in my home directory, but when I run

send_email_out(
  message = email_object,
  from = "<myaccount>@gmail.com",
  to = "<email_destination>",
  subject = "Testing.",
  creds_file = "~/.e_creds")

I get:

Error in system(command = command, intern = TRUE) : 'C:/<my home dir>/R/mailsend' not found

Use sendmail pkg or mailgun http api

Would be nice to get rid of the Java dependency. The sendmailR package allows for sending email via an aribtrary smtp server, but if you're using mailgun you might as well use their rest api.

Error in system : mailsend

Error in system(command = command, intern = TRUE) :
'C:/Users/Administrator/Documents/mailsend' not found

Compose email crashes unless a line break is specified

When I use compose_email with add_ggplot and formattable sometimes my session crashes. I say sometimes, because it appears to depend on the size of the ggplot and the platform. I was not able to reproduce the error on my desktop, but I was able to reproduce it on RSP.

The problem occurs when I include a plot and a table in compose_email:

compose_email("Hello! {add_ggplot(myplot)} {formattable(head(mytable))}")

image

I would not expect this code to unexpectedly crash my session. Instead I would expect it to produce an email with a plot and a table. I found that if explicitly called for a line break, then the code will work:

compose_email("Hello! {add_ggplot(myplot)} \n {formattable(head(mytable))}")

The \n line break must be explicit. If I use carriage returns without the line break, I get the same error above. If I remove either the plot or the table, I do not get an error. But if I leave out \n then my session crashes for this particular plot and table on RSP. I think the code should not require an explicit line break.

Create family of functions that provide conveniences for working with images

Some examples of functions for image handling:

  • create tags using remote images already available on a server
  • upload local image to server or CDN through httr (obtaining just the URL or the URL already included in a formatted <img> tag)
  • checking existence/previewing images on a server
  • creating an <img> tag (with Base64 URI and CID) using a local image
  • convenience functions for converting popular visualization objects to local images for use with some of the above functions

Bare Line Feed Characters Error

When I send an email from Blastula using my SMTP server any emails sent to gmail return as undeliverable. Any ideas how to remove the Break line feeds which are causing this error?

gmailr support

I had been meaning to look into this next time I do a pass on gmailr, I think it should be relatively straightforward to add support.

Compose email crashes on RHEL

Hi,

compose_email function works well on Mac, but it crashes on RHEL. Is anyone able to work with this function on Rhel ? How can we handle this ?

I already installed and updated the necessary dependencies:

sudo yum install openssl-devel

Error in system(command = command, intern = TRUE) : 'CreateProcess' failed

I am getting an error when I run send_email_out. Mailsend is a black box to me so I'm uncertain where to go from here, I couldn't find a similar issue on their github page... Any help would be much appreciated!

Thanks,
Mark

Error in system(command = command, intern = TRUE) :
'CreateProcess' failed to run 'C:\Users\markd\Desktop\mailsend.exe -from "[email protected]" -name "[email protected]" -t "[email protected]" +cc +bc -sub "Utilization Report" -starttls -smtp outlook.office365.com -port 587 -auth -user [email protected] -pass "" -mime-type "text/html" -enc-type "us-ascii" -disposition "inline" -attach "message_inlined.html" '

Restructure `email_message` object

It shouldn't really have html_str and html_html components. Instead, it should just contain whichever of those has data URIs and not cid’s. And then there should be another function to convert that HTML to cid-ed HTML and content parts (i.e., image attachments).

Subject line in RSC-RMarkdown emailing

Currently the subject line for an email message from an RSC-RMarkdown process is contained in the YAML front matter of the main .Rmd document as:

---
...
rmd_output_metadata:
  rsc_email_subject: Subject of Email
...
---

The subject of the email really shouldn't live here, it should reside in the email .Rmd document. Further to this, the function call that renders an email (render_email()) should have a subject argument that overrides the same in the YAML.

cc: @slopp

plots in `gt` tables disappear on send

I'm using this example to render ggplot sparklines in a gt table, and then trying to send that table via blastula.

The table renders fine in RStudio, as does an email object containing it, e.g:

email_text <-
  "
Here's the table

{as_raw_html(my_gt_table)}
"

email_object <-
  compose_email(
    body = email_text)

print(email_object)

The viewer pane will correctly show the sparklines. However, when I call smtp_send() with my GMail credentials, the resulting email does not display the plots - the column is blank.

I'm sure I'm just doing something stupid, any debugging tips?

Aligning emails body

Hi, many thanks for great R package!

I am using smtp.office365.com as the SMTP
When I opening emails in Outlook the email body is right aligned.
When I using Office365 (https://smtp.office365.com/owa/) the email body is center aligned.

  1. How can I make the emails center aligned in Outlook?
  2. How to resize container of the email body (increase width)?

outlook_
office365_

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.