send_by_mailgun: Send an email message through the Mailgun API

Description Usage Arguments Examples

View source: R/send_by_mailgun.R

Description

Send an email message via the Mailgun API. This requires an account with Mailgun.

Usage

1
send_by_mailgun(message, subject = NULL, from, recipients, url, api_key)

Arguments

message

The email message object, as created by the compose_email() function. The object's class is email_message

subject

The subject of the email.

from

The email address of the sender. This does not have to be the same email that is associated with the account actually sending the message.

recipients

A vector of email addresses.

url

The URL for the sending domain.

api_key

The API key registered to the Mailgun service.

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
25
26
27
28
29
30
31
32
33
# Create a simple email message using
# Markdown formatting

# email <-
#   compose_email(
#   body = "
#   Hello!
#
#   ## This a section heading
#
#   We can use Markdown formatting \
#   to **embolden** text or to add \
#   *emphasis*. This is exciting, \
#   right?
#
#   Cheers")

# Generate a vector of recipients

# recipient_list <-
#   c("person_1@site.net",
#     "person_2@site.net")

# Send it to multiple people through
# the Mailgun API

# email %>%
#   send_by_mailgun(
#     subject = "Sent through Mailgun",
#     from = "The Sender <sender@send.org>",
#     recipients = recipient_list,
#     url = "<..mailgun_sending_domain..>",
#     api = "<..mailgun_api_key..>")

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