Class: Trycourier::Models::ElementalChannelNode

Inherits:
ElementalBaseNode show all
Defined in:
lib/trycourier/models/elemental_channel_node.rb

Direct Known Subclasses

ElementalChannelNodeWithType

Instance Attribute Summary collapse

Attributes inherited from ElementalBaseNode

#channels, #if_, #loop_, #ref

Instance Method Summary collapse

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(channel: , raw: nil) ⇒ Object

Some parameter documentations has been truncated, see Trycourier::Models::ElementalChannelNode for more details.

The channel element allows a notification to be customized based on which channel it is sent through. For example, you may want to display a detailed message when the notification is sent through email, and a more concise message in a push notification. Channel elements are only valid as top-level elements; you cannot nest channel elements. If there is a channel element specified at the top-level of the document, all sibling elements must be channel elements. Note: As an alternative, most elements support a ‘channel` property. Which allows you to selectively display an individual element on a per channel basis. See the [control flow docs](www.courier.com/docs/platform/content/elemental/control-flow/) for more details.

Parameters:

  • channel (String) (defaults to: )

    The channel the contents of this element should be applied to. Can be ‘email`,

  • raw (Hash{Symbol=>Object}, nil) (defaults to: nil)

    Raw data to apply to the channel. If ‘elements` has not been specified, `raw` is



# File 'lib/trycourier/models/elemental_channel_node.rb', line 20


Instance Attribute Details

#channelString

The channel the contents of this element should be applied to. Can be ‘email`, `push`, `direct_message`, `sms` or a provider such as slack

Returns:

  • (String)


11
# File 'lib/trycourier/models/elemental_channel_node.rb', line 11

required :channel, String

#rawHash{Symbol=>Object}?

Raw data to apply to the channel. If ‘elements` has not been specified, `raw` is required.

Returns:

  • (Hash{Symbol=>Object}, nil)


18
# File 'lib/trycourier/models/elemental_channel_node.rb', line 18

optional :raw, Trycourier::Internal::Type::HashOf[Trycourier::Internal::Type::Unknown], nil?: true