Hi all,
Hope all are good and safe
I have a 2 documents (doc.Rmd and email.Rmd) where it is generating automatic mail to my inbox. When I run doc.Rmd locally, I get the output without any special characters. But when I run, email.Rmd and generate the mail, the mail body contains special characters (her in this case, I get = sign at the end and this is weird. Not sure why? Can anyone help me here?
doc.Rmd
---
output:
html_document: default
pdf_document: default
---
---
title: IRIS
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
library(blastula)
library(dplyr)
library(formattable)
library(RODBC)
```
```{r email_body, echo=FALSE, message=FALSE, warning=FALSE, paged.print=FALSE}
formatted_table <- format_table(x = head(iris))
```
```{r email_body2, echo=FALSE, message=FALSE, warning=FALSE, paged.print=FALSE}
formatted_table
```
email.Rmd
---
title: "Email Report"
output: blastula::blastula_email
---
```{r email_setup, include=FALSE}
library(blastula)
library(mime)
library(magrittr)
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>"
)
```
```{r email_intro, echo=FALSE}
date_time <- add_readable_time()
email <- render_email('doc.Rmd')
if(Sys.getenv("XXX")=="YYYY") {
email %>%
smtp_send(
from = "XXX.com",
to = c("XXX.com"),
subject = paste0("IRIS",Sys.Date(),":"),
credentials = creds_anonymous(host = "XXX,com",port=YY, use_ssl = FALSE)
)
} else {
email %>%
smtp_send(
from = "XXX.com",
to = c("XXX.com"),
subject = paste0("IRIS",Sys.Date(),":"),
credentials = creds_anonymous(host = "XXX,com",port=YY, use_ssl = FALSE)
)
}
```