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.
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 |
{
"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"
}
} ]
}
}