prepare_test_message: Prepare a email test message object

Description Usage Arguments Value Examples

View source: R/prepare_test_message.R

Description

Create an email test message object, which is helpful for sending a test message with the smtp_send() function.

Usage

1
prepare_test_message(incl_ggplot = FALSE, incl_image = FALSE)

Arguments

incl_ggplot

An option to include a ggplot plot within the body of the test message. This requires that the ggplot2 package is installed. By default, this is FALSE.

incl_image

An option to include a test image within the body of the test message. By default, this is FALSE.

Value

An email_message object.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# Create a credentials file to send
# a test message via Gmail's SMTP
# (this file is named "gmail_secret")

# create_smtp_creds_file(
#   file = "gmail_secret",
#   user = "sender@email.com",
#   provider = "gmail"
# )

# Send oneself a test message to
# test these new SMTP settings and
# to ensure that the message appears
# correctly in the email client

# prepare_test_message() %>%
#   smtp_send(
#     from = "sender@email.com",
#     to = "sender@email.com",
#     subject = "Test Message",
#     credentials = creds_file(
#       file = "gmail_secret"
#       )
#     )

rich-iannone/blastula documentation built on Oct. 17, 2020, 8:59 p.m.