Class: Courier::Models::NotificationTemplateEmail

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/courier/models/notification_template_email.rb,
sig/courier/models/notification_template_email.rbs

Instance Attribute Summary collapse

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(bcc: nil, cc: nil, from: nil, reply_to: nil) ⇒ NotificationTemplateEmail

Email header fields for the template's email channel: the From, Reply-to, CC and BCC values set in the Studio email channel settings. Each value may use template variables, such as {{data.cc}}, which are resolved at send time. Reads omit email when no header is set, and omit each unset field. Writes treat it as optional, with three meanings. Omit it to keep the stored headers. Send null to clear all four. Send an object to replace all four: a field the object leaves out is cleared. Other email channel settings, such as the subject, are kept either way. Headers only apply while content has an email channel; with no email channel they are not stored.

Parameters:

  • bcc (Array<String>) (defaults to: nil) —

    BCC addresses.

  • cc (Array<String>) (defaults to: nil) —

    CC addresses.

  • from (String) (defaults to: nil) —

    The From address.

  • reply_to (String) (defaults to: nil) —

    The Reply-to address.

  • bcc: (::Array[String]) (defaults to: nil)
  • cc: (::Array[String]) (defaults to: nil)
  • from: (String) (defaults to: nil)
  • reply_to: (String) (defaults to: nil)


# File 'lib/courier/models/notification_template_email.rb', line 30

Instance Attribute Details

#bcc ⇒ Array<String>?

BCC addresses.

Parameters:

  • (::Array[String])

Returns:

  • (Array<String>, nil)


10
# File 'lib/courier/models/notification_template_email.rb', line 10

optional :bcc, Courier::Internal::Type::ArrayOf[String]

#cc ⇒ Array<String>?

CC addresses.

Parameters:

  • (::Array[String])

Returns:

  • (Array<String>, nil)


16
# File 'lib/courier/models/notification_template_email.rb', line 16

optional :cc, Courier::Internal::Type::ArrayOf[String]

#from ⇒ String?

The From address.

Parameters:

  • (String)

Returns:

  • (String, nil)


22
# File 'lib/courier/models/notification_template_email.rb', line 22

optional :from, String

#reply_to ⇒ String?

The Reply-to address.

Parameters:

  • (String)

Returns:

  • (String, nil)


28
# File 'lib/courier/models/notification_template_email.rb', line 28

optional :reply_to, String

Instance Method Details

#to_hash ⇒ { bcc: ::Array[String], cc: ::Array[String], from: String, reply_to: String }

Returns:

  • ({ bcc: ::Array[String], cc: ::Array[String], from: String, reply_to: String })


35
36
37
38
39
40
# File 'sig/courier/models/notification_template_email.rbs', line 35

def to_hash: -> {
  bcc: ::Array[String],
  cc: ::Array[String],
  from: String,
  reply_to: String
}