Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

add_cta_button

Create an HTML fragment for a CTA button


Description

Create the HTML fragment for a call to action button. This can be used as part of the email body but, since this HTML, it must be contained within md(). 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

# 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 using it as part of
# a vector inside of `md()`
email <-
  compose_email(
    body = md(
      c(
  "Pressing the button will take
  you to an example website",
  cta_button
      )
    )
  )

if (interactive()) email

blastula

Easily Send HTML Email Messages

v0.3.2
MIT + file LICENSE
Authors
Richard Iannone [aut, cre] (<https://orcid.org/0000-0003-3925-190X>), Joe Cheng [aut], Jeroen Ooms [ctb] (<https://orcid.org/0000-0002-4035-0289>), Ted Goas [cph] (cerberus-meta.html)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.