Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
47 lines (42 sloc) 3.11 KB

Button block

The button block allows you to add buttons, optimized for HTML email, to your email document. But unlike what you would expect, an email button is not turned into a HTML <button> tag, but built using a HTML <table> by the Responsive Email API, because it renders better on different email clients.

Button block properties

Property Value Desc.
type "button" Property to identify block as button
label string Label of the button
link mixed Link that is opened when the button is clicked
font object Font properties for the button label
color string Color of a button
size mixed Size of a button
corners string Button (rounded) corners
css object Add custom css to the button
attributes object Add custom HTML attributes to the button
visibility object Visibility based on device, client and/or receiver
container object Get access to the table cell that houses this block
margin mixed Whitespace around the block
padding mixed Whitespace around the block, this whitespace will have a background
background object The background of the block

Example

{
    "from" : "info@example.com",
    "subject" : "Email with a single button",
    "content" : {
        "blocks" : [ {
            "type"      : "button",
            "size"      : 10,
            "corners"   : "round",
            "label"     : "Click me!",
            "color"     : "red",
            "link" : {
                "url" : "http://example.com",
                "title" : "Buy an example"
            }
        } ]
    }
}
You can’t perform that action at this time.