Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion R/blastula_email_format.R
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@
#' default definition or R Markdown.
#' @param connect_footer Should a prepared footer message with links be included
#' in the rendered email?
#' @param background_color The color to use for the e-mail's background. You
#' can provide any valid color specification supported by the
#' [`background-color` CSS property](https://developer.mozilla.org/docs/Web/CSS/background-color).
#' @param ... Specify other options in [rmarkdown::html_document()].
#'
#' @export
Expand All @@ -58,13 +61,15 @@ blastula_email <- function(toc = FALSE,
keep_md = FALSE,
md_extensions = NULL,
connect_footer = FALSE,
background_color = "#f6f6f6",
...) {

if (template == "blastula") {
template <- system.file("rmd", "template.html", package = "blastula")
}

pandoc_args <- NULL
pandoc_args <- paste0("--variable=background-color:", background_color)

if (isTRUE(connect_footer)) {
pandoc_args <- c(
pandoc_args,
Expand Down
4 changes: 2 additions & 2 deletions R/bls_template.R
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@ bls_standard_template <- function() {
</xml>
<![endif]-->
</head>
<body style=\"font-family: Helvetica, sans-serif; -webkit-font-smoothing: antialiased; font-size: 14px; line-height: 1.4; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; background-color: #f6f6f6; margin: 0; padding: 0;\">
<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"body\" style=\"border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; width: 100%; background-color: #f6f6f6;\" width=\"100%\" bgcolor=\"#f6f6f6\">
<body style=\"font-family: Helvetica, sans-serif; -webkit-font-smoothing: antialiased; font-size: 14px; line-height: 1.4; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; background-color: {background_color}; margin: 0; padding: 0;\">
<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"body\" style=\"border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; width: 100%; background-color: {background_color};\" width=\"100%\" bgcolor=\"{background_color}\">
<tr>
<td style=\"font-family: Helvetica, sans-serif; font-size: 14px; vertical-align: top;\" valign=\"top\">&nbsp;</td>
<td class=\"container\" style=\"font-family: Helvetica, sans-serif; font-size: 14px; vertical-align: top; margin: 0 auto !important; max-width: 600px; padding: 0; padding-top: 24px; width: 600px;\" width=\"600\" valign=\"top\">
Expand Down
4 changes: 4 additions & 0 deletions R/compose_email.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
#' in `...`. Alternatively, we can supply a set of `block_*()` calls enclosed
#' within the [blocks()] function to take advantage of precomposed HTML
#' blocks.
#' @param background_color The color to use for the e-mail's background. You
#' can provide any valid color specification supported by the
#' [`background-color` CSS property](https://developer.mozilla.org/docs/Web/CSS/background-color).
#' @param .title The title of the email message. This is not the subject but the
#' HTML title text which may appear in limited circumstances.
#' @param .envir An opportunity to specify the environment. By default, this is
Expand Down Expand Up @@ -70,6 +73,7 @@
compose_email <- function(body = NULL,
header = NULL,
footer = NULL,
background_color = "#f6f6f6",
.title = NULL,
.envir = parent.frame(),
...) {
Expand Down
4 changes: 2 additions & 2 deletions inst/rmd/template.html
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@
}
</style>
</head>
<body class="" style="background-color: #f6f6f6; font-family: sans-serif; -webkit-font-smoothing: antialiased; font-size: 14px; line-height: 1.4; margin: 0; padding: 0; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%;">
<table border="0" cellpadding="0" cellspacing="0" class="body" style="border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; width: 100%; background-color: #f6f6f6;">
<body class="" style="background-color: $background-color$; font-family: sans-serif; -webkit-font-smoothing: antialiased; font-size: 14px; line-height: 1.4; margin: 0; padding: 0; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%;">
<table border="0" cellpadding="0" cellspacing="0" class="body" style="border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; width: 100%; background-color: $background-color$;">
<tr>
<td style="font-family: sans-serif; font-size: 14px; vertical-align: top;">&nbsp;</td>
<td class="container" style="font-family: sans-serif; font-size: 14px; vertical-align: top; display: block; Margin: 0 auto; max-width: 580px; padding: 10px; width: 580px;">
Expand Down
6 changes: 5 additions & 1 deletion man/blastula_email.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion man/compose_email.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.