Learn R Programming

blastula (version 0.2.1)

add_cta_button: Helper function for adding a CTA button

Description

Add a call to action button inside the body of the email with this helper function. There are options to specify the button text, the URL, and the button's alignment.

Usage

add_cta_button(url, text, align = "center")

Arguments

url

a URL for the button.

text

the text that is placed atop the CTA button.

align

the alignment of the button inside the main content area. Options are center (the default), left, and right.

Value

a character object with an HTML fragment that can be placed inside the message body wherever the CTA button should appear.

Examples

Run this code
# NOT RUN {
# Create the button as an HTML fragment
cta_button <-
  add_cta_button(
    url = "http://www.website.net",
    text = "Press This Button")

# Include the button in the email
# message body by simply referencing
# the `cta_button` object
email <-
  compose_email(
    body = "
    Hello!

    Below is a call. It's a call \\
    to action. Press it!

    {cta_button}

    Cheers
    ")
# }

Run the code above in your browser using DataLab