Overview
The action element allows users to execute actions in your notifications. It can be rendered as either a button or a link, depending on the channel and styling options you choose. When to use:- Add call-to-action buttons (e.g., “Sign Up”, “View Order”, “Confirm Email”)
- Create clickable links within notifications
- Provide interactive elements that direct users to specific URLs
Basic Example
Fields
The type of element. For action elements, this value must be
"action".The text content of the action shown to the user. This is the label displayed on the button or link.
The target URL of the action. When clicked, the user will be directed to this URL.
A unique identifier used to identify the action when it is executed. Useful for tracking and analytics.
The alignment of the action button. One of
"center", "left", "right", or "full". Defaults to "center".The background color of the action button. Can be any valid CSS color value (e.g.,
"#007bff", "rgb(0, 123, 255)").The visual style of the action. Can be
"button" or "link". Defaults to "button".Region-specific content for localization. See the Locales documentation for more details.
Examples & Variants
Button Style
The default button style renders as a clickable button:Link Style
Use link style for a more subtle, text-based link:Styled Button
Customize the button appearance with colors and alignment:With Localization
Localize action content and URLs:With Conditional Logic
Show different actions based on conditions:Channel Support
Action elements are supported across all channels:- Email: Renders as a button or link depending on style
- Push: Renders as a clickable action button
- SMS: Renders as a clickable link
- Inbox: Renders as an interactive button
Related Elements
- Text Element - For non-interactive text content
- Image Element - For images that can also link via
href - Control Flow - For conditional rendering and loops
- Locales - For localizing action content and URLs