Class: AWSCDK::SES::CfnTemplate::TemplateProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
ses/cfn_template.rb

Overview

An object that defines the email template to use for an email message, and the values to use for any message variables in that template.

An email template is a type of message template that contains content that you want to reuse in email messages that you send. You can specifiy the email template by providing the name or ARN of an email template previously saved in your Amazon SES account or by providing the full template content.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(subject_part:, html_part: nil, template_name: nil, text_part: nil) ⇒ TemplateProperty

Returns a new instance of TemplateProperty.

Parameters:

  • subject_part (String)

    The subject line of the email.

  • html_part (String, nil) (defaults to: nil)

    The HTML body of the email.

  • template_name (String, nil) (defaults to: nil)

    The name of the template.

  • text_part (String, nil) (defaults to: nil)

    The email body that is visible to recipients whose email clients do not display HTML content.



529
530
531
532
533
534
535
536
537
538
# File 'ses/cfn_template.rb', line 529

def initialize(subject_part:, html_part: nil, template_name: nil, text_part: nil)
  @subject_part = subject_part
  Jsii::Type.check_type(@subject_part, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "subjectPart")
  @html_part = html_part
  Jsii::Type.check_type(@html_part, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "htmlPart") unless @html_part.nil?
  @template_name = template_name
  Jsii::Type.check_type(@template_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "templateName") unless @template_name.nil?
  @text_part = text_part
  Jsii::Type.check_type(@text_part, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "textPart") unless @text_part.nil?
end

Instance Attribute Details

#html_partString? (readonly)

The HTML body of the email.



549
550
551
# File 'ses/cfn_template.rb', line 549

def html_part
  @html_part
end

#subject_partString (readonly)

The subject line of the email.



544
545
546
# File 'ses/cfn_template.rb', line 544

def subject_part
  @subject_part
end

#template_nameString? (readonly)

The name of the template.

You will refer to this name when you send email using the SendEmail or SendBulkEmail operations.



556
557
558
# File 'ses/cfn_template.rb', line 556

def template_name
  @template_name
end

#text_partString? (readonly)

The email body that is visible to recipients whose email clients do not display HTML content.



561
562
563
# File 'ses/cfn_template.rb', line 561

def text_part
  @text_part
end

Class Method Details

.jsii_propertiesObject



563
564
565
566
567
568
569
570
# File 'ses/cfn_template.rb', line 563

def self.jsii_properties
  {
    :subject_part => "subjectPart",
    :html_part => "htmlPart",
    :template_name => "templateName",
    :text_part => "textPart",
  }
end

Instance Method Details

#to_jsiiObject



572
573
574
575
576
577
578
579
580
581
# File 'ses/cfn_template.rb', line 572

def to_jsii
  result = {}
  result.merge!({
    "subjectPart" => @subject_part,
    "htmlPart" => @html_part,
    "templateName" => @template_name,
    "textPart" => @text_part,
  })
  result.compact
end