Class: Courier::Models::ElementalActionNode
- Inherits:
-
ElementalBaseNode
- Object
- Internal::Type::BaseModel
- ElementalBaseNode
- Courier::Models::ElementalActionNode
- Defined in:
- lib/courier/models/elemental_action_node.rb,
sig/courier/models/elemental_action_node.rbs
Direct Known Subclasses
ElementalActionNodeWithType, Courier::Models::ElementalNodeNonChannel::UnionMember3
Defined Under Namespace
Modules: Style
Instance Attribute Summary collapse
-
#action_id ⇒ String?
A unique id used to identify the action when it is executed.
-
#align ⇒ Symbol, ...
The alignment of the action button.
-
#background_color ⇒ String?
The background color of the action button.
-
#border_radius ⇒ String?
CSS border-radius applied to the action button.
-
#border_size ⇒ String?
CSS border width applied to the action button.
-
#content ⇒ String
The text content of the action shown to the user.
-
#disable_tracking ⇒ Boolean?
When true, the action's href is not rewritten for click-through tracking, even when click-through tracking is enabled for the workspace.
-
#font_size ⇒ String?
CSS font-size applied to the action button label.
-
#href ⇒ String
The target URL of the action.
-
#locales ⇒ Hash{Symbol=>Courier::Models::LocaleItem}?
Region specific content.
-
#padding ⇒ String?
CSS padding applied to the action button.
-
#style ⇒ Symbol, ...
How prominent the action should be.
Attributes inherited from ElementalBaseNode
Instance Method Summary collapse
-
#initialize(content:, href:, action_id: nil, align: nil, background_color: nil, border_radius: nil, border_size: nil, disable_tracking: nil, font_size: nil, locales: nil, padding: nil, style: nil) ⇒ Object
constructor
Some parameter documentations has been truncated, see ElementalActionNode for more details.
- #to_hash ⇒ {
Methods inherited from Internal::Type::BaseModel
==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml
Methods included from Internal::Type::Converter
#coerce, coerce, #dump, dump, inspect, #inspect, meta_info, new_coerce_state, type_info
Methods included from Internal::Util::SorbetRuntimeSupport
#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type
Constructor Details
#initialize(content:, href:, action_id: nil, align: nil, background_color: nil, border_radius: nil, border_size: nil, disable_tracking: nil, font_size: nil, locales: nil, padding: nil, style: nil) ⇒ Object
Some parameter documentations has been truncated, see Courier::Models::ElementalActionNode for more details.
Allows the user to execute an action. Can be a button or a link.
|
|
# File 'lib/courier/models/elemental_action_node.rb', line 94
|
Instance Attribute Details
#action_id ⇒ String?
A unique id used to identify the action when it is executed.
22 |
# File 'lib/courier/models/elemental_action_node.rb', line 22 optional :action_id, String, nil?: true |
#align ⇒ Symbol, ...
The alignment of the action button. Defaults to "center".
28 |
# File 'lib/courier/models/elemental_action_node.rb', line 28 optional :align, enum: -> { Courier::Alignment }, nil?: true |
#background_color ⇒ String?
The background color of the action button.
34 |
# File 'lib/courier/models/elemental_action_node.rb', line 34 optional :background_color, String, nil?: true |
#border_radius ⇒ String?
CSS border-radius applied to the action button. For example, 4px
40 |
# File 'lib/courier/models/elemental_action_node.rb', line 40 optional :border_radius, String, nil?: true |
#border_size ⇒ String?
CSS border width applied to the action button. For example, 1px
46 |
# File 'lib/courier/models/elemental_action_node.rb', line 46 optional :border_size, String, nil?: true |
#content ⇒ String
The text content of the action shown to the user.
10 |
# File 'lib/courier/models/elemental_action_node.rb', line 10 required :content, String |
#disable_tracking ⇒ Boolean?
When true, the action's href is not rewritten for click-through tracking, even when click-through tracking is enabled for the workspace.
53 |
# File 'lib/courier/models/elemental_action_node.rb', line 53 optional :disable_tracking, Courier::Internal::Type::Boolean, nil?: true |
#font_size ⇒ String?
CSS font-size applied to the action button label. For example, 14px
59 |
# File 'lib/courier/models/elemental_action_node.rb', line 59 optional :font_size, String, nil?: true |
#href ⇒ String
The target URL of the action.
16 |
# File 'lib/courier/models/elemental_action_node.rb', line 16 required :href, String |
#locales ⇒ Hash{Symbol=>Courier::Models::LocaleItem}?
Region specific content. See locales docs for more details.
67 |
# File 'lib/courier/models/elemental_action_node.rb', line 67 optional :locales, -> { Courier::Internal::Type::HashOf[Courier::LocaleItem] }, nil?: true |
#padding ⇒ String?
CSS padding applied to the action button. For example, 8px 16px
73 |
# File 'lib/courier/models/elemental_action_node.rb', line 73 optional :padding, String, nil?: true |
#style ⇒ Symbol, ...
How prominent the action should be. button is the default, secondary and
tertiary are the other two button styles, and link renders as inline text
rather than a button.
Each channel draws these as closely as its medium allows. Email fills button,
outlines secondary, and underlines tertiary. The in-app Inbox fills
button, outlines secondary, and draws tertiary as a solid button. Slack
renders all three as Block Kit buttons, with secondary in Slack's primary
style and tertiary in its danger style.
background_color is the fill for button, and the border and label color for
secondary. For tertiary it colors the underline and label in email and the
fill in the Inbox. It does not apply to link. An Inbox theme that sets its own
action colors takes precedence over the template.
92 |
# File 'lib/courier/models/elemental_action_node.rb', line 92 optional :style, enum: -> { Courier::ElementalActionNode::Style }, nil?: true |
Instance Method Details
#to_hash ⇒ {
85 |
# File 'sig/courier/models/elemental_action_node.rbs', line 85
def to_hash: -> {
|