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.
A pointblank agent object that is commonly created through the use of the create_agent() function.
msg_header, msg_body, msg_footer: Content for the header, body, and footer components of the HTML email message.
Returns
A blastula email_message object.
Examples
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.