🏢
Interfaces
This page provides documentation for the interfaces used in the Email Builder project.
These interfaces define the structure and styling of various blocks and elements that can be used to create responsive email templates.
Each interface has its own set of properties that can be customized to achieve the desired design.
Understanding these interfaces is essential for creating custom email templates using the Email Builder project. With these interfaces, you can customize the look and feel of each block or element in your email template to achieve your desired design.
The
IMjmlServerResponseErrors
interface describes the error response returned by the MJML server when converting an email template. It has the following properties:message
(string): The error message returned by the server.tagName
(string): The name of the MJML tag that caused the error.
The
IMjmlServerResponse
interface describes the response returned by the MJML server when converting an email template. It has the following properties:html
(string): The converted HTML template is based on theIIPEmail
interface.mjml
(string): The converted MJML template is based on theIIPEmail
interface.errors
(array ofIMjmlServerResponseErrors
): An array of error objects returned by the server.
The
TStructureTypes
type defines the available structure types that can be used with the Structure
class. It has the following possible values:"cols_1"
"cols_2"
"cols_3"
"cols_4"
"cols_5"
"cols_6"
"cols_12"
"cols_21"
The
TDirection
type defines the available text direction options that can be used in the IGeneralOptions
interface. It has the following possible values:"ltr"
"rtl"
The
TUnits
type defines the available units that can be used for width and height values in the various block options. It has the following possible values:"%"
"px"
"cover"
"contain"
The
TAlign
type defines the available horizontal alignment options that can be used in the various block options. It has the following possible values:"left"
"center"
"right"
The
TVerticalAlign
type defines the available vertical alignment options that can be used in the SocialBlock
options. It has the following possible values:"top"
"middle"
"bottom"
The
TLineHeight
type defines the available line height options that can be used in the various block options. It has the following possible values:"%"
"px"
"none"
The
TLinkTarget
type defines the available link target options that can be used in the ButtonBlock
and LinkBlock
options. It has the following possible values:"_blank"
"_self"
"_parent"
"_top"
The
TFontStyle
type defines the available font style options that can be used in the Font
options. It has the following possible values:"italic"
"normal"
"oblique"
The
TFontWeight
type defines the available font weight options that can be used in the Font
options. It has the following possible values:- A numeric value representing the font-weight.
"normal"
"bold"
"bolder"
"lighter"
- A custom font-weight value.
The
TBackgroundRepeat
type defines the available background repeat options that can be used in the Background
options. It has the following possible values:"no-repeat"
"repeat"
"repeat-x"
"repeat-y"
Builder border styles interface.
Properties:
color: string
: Border color.style: "solid" | "dotted" | "dashed" | "double" | "groove"
: Border style.width: number
: Border width.radius: number
: Border radius.
The
IFont
interface describes the font style of a block. It has the following properties:family
(string): Font family name.fallback
(string): Fallback font family name.size
(number): Font size in pixels.
The
IPadding
interface describes the padding of a block. It has the following optional properties:top
(number): Padding size for the top side of the block.right
(number): Padding size for the right side of the block.bottom
(number): Padding size for the bottom side of the block.left
(number): Padding size for the left side of the block.
The
ILink
interface defines the properties that can be used to customize the behavior and appearance of links in email blocks. It has the following properties:url
: The URL that the link should point to.title
: The title attribute of the link element.target
: The target attribute of the link element. This can be one of "_self", "_blank", "_parent", or "_top".
The
IMargin
interface describes the margin of a block. It has the following optional properties:top
(number): Margin size for the top side of the block.bottom
(number): Margin size for the bottom side of the block.
The
ILineHeight
interface represents the line-height CSS property, which sets the height of a line box.Properties:
value
: The numeric value of the line height. Default is22
.unit
: The unit of measurement for the line height. Possible values arepx
,%
, ornone
. Default ispx
.
The
IBackground
interface represents the CSS background style.Properties:
color
: The color of the background. Default iswhite
.url
: The URL of the background image.repeat
: The repeat style of the background image. Possible values areno-repeat
,repeat
,repeat-x
, orrepeat-y
. Default isno-repeat
.
The
IWidthHeight
interface represents the width and height CSS properties.Properties:
value
: The numeric value of the width or height. Default is100
.unit
: The unit of measurement for the width or height. Possible values arepx
,%
,cover
, orcontain
. Default is%
.auto
: Iftrue
, the width or height is set toauto
. Default isfalse
.units
: An array of possible unit values.
The
IUserModule
interface defines a user module object that can be used to store user-defined modules. A user module consists of a name and an instance of the IStructure
interface.Properties:
name
: A string representing the name of the user module.module
: An instance of theIStructure
interface that represents the module structure.
The
IUserTemplateCategory
interface defines a user template category that can be used to group templates in the Template Gallery. A user template category consists of a category name and an array of template names.Properties:
category
: A string representing the name of the template category.templates
: An array of strings representing the names of the templates in the category.
The
TIPEmailBuilderStyles
type is a record that can hold any style property. This type can be used to define custom styles for various elements in an email template.Last modified 5mo ago