Button Block
The Button Block is a block that allows you to add a button to your email. It supports several options to help you customize the appearance of the button.
Options
backgroundColor
: The background color of the button.border
: The border of the button. This is an instance of theIBorder
interface.color
: The text color of the button.font
: The font of the text on the button. This is an instance of theIFont
interface.align
: The alignment of the button. This can be one of the following values:left
: The button is aligned to the left.center
: The button is centered.right
: The button is aligned to the right.
fullWidth
: A boolean value indicating whether the button should take up the full width of its container.lineHeight
: The line height of the text on the button. This is an instance of theILineHeight
interface.link
: The link that the button should open when clicked. This is an instance of theILink
interface.innerPadding
: The padding inside the button. This is an instance of theIPadding
interface.padding
: The padding around the button. This is an instance of theIPadding
interface.
Usage
To use the Button Block in your email, you can create a new instance of the ButtonBlock
class and customize its options. Here’s an example:
In this example, we’ve customized the background color, border, text color, font, alignment, line height, link, and padding of the Button Block, and provided some text content to display on the button.
{% hint style=“info” %}
Note: The align
option only affects the horizontal alignment of the button. Vertical alignment is determined by the container in which the button is placed.
{% endhint %}