email_create | R Documentation |
The email_create()
function produces an email message object that could be
sent using the blastula package. By supplying a pointblank agent, a
blastula email_message
message object will be created and printing it
will make the HTML email message appear in the Viewer.
email_create(
x,
msg_header = NULL,
msg_body = stock_msg_body(),
msg_footer = stock_msg_footer()
)
x |
The pointblank agent object
A pointblank agent object that is commonly created through the use of
the |
msg_header , msg_body , msg_footer |
Content for the header, body, and footer components of the HTML email message. |
A blastula email_message
object.
For the example provided here, we'll use the included small_table
dataset.
We are also going to create an action_levels()
list object since this is
useful for demonstrating an emailing scenario. It will have absolute values
for the warn
and notify
states (with thresholds of 1
and 2
'fail'
units, respectively, for the two states).
al <- action_levels( warn_at = 1, notify_at = 2 )
In a workflow that involves an agent
object, we can make use of the
end_fns
argument and programmatically email the report with the
email_blast()
function. However, an alternate workflow that is demonstrated
here is to produce the email object directly. This provides the flexibility
to send the email outside of the pointblank API. The email_create()
function lets us do this with an agent
object. We can then view the HTML
email just by printing email_object
. It should appear in the Viewer.
email_object <- create_agent( tbl = small_table, tbl_name = "small_table", label = "An example.", actions = al ) %>% col_vals_gt(a, value = 1) %>% col_vals_lt(a, value = 7) %>% interrogate() %>% email_create() email_object
4-2
Other Emailing:
email_blast()
,
stock_msg_body()
,
stock_msg_footer()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.