Class: Mailtrap::EmailTemplate

Inherits:
Struct
  • Object
show all
Defined in:
lib/mailtrap/email_template.rb

Overview

Data Transfer Object for Email Template

For field descriptions and response format, see the official API documentation:

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#body_htmlString (readonly)

The HTML content

Returns:

  • (String)

    the current value of body_html



18
19
20
# File 'lib/mailtrap/email_template.rb', line 18

def body_html
  @body_html
end

#body_textString (readonly)

The plain text content

Returns:

  • (String)

    the current value of body_text



18
19
20
# File 'lib/mailtrap/email_template.rb', line 18

def body_text
  @body_text
end

#categoryString (readonly)

The template category

Returns:

  • (String)

    the current value of category



18
19
20
# File 'lib/mailtrap/email_template.rb', line 18

def category
  @category
end

#created_atString (readonly)

The creation timestamp

Returns:

  • (String)

    the current value of created_at



18
19
20
# File 'lib/mailtrap/email_template.rb', line 18

def created_at
  @created_at
end

#idInteger (readonly)

The template ID

Returns:

  • (Integer)

    the current value of id



18
19
20
# File 'lib/mailtrap/email_template.rb', line 18

def id
  @id
end

#nameString (readonly)

The template name

Returns:

  • (String)

    the current value of name



18
19
20
# File 'lib/mailtrap/email_template.rb', line 18

def name
  @name
end

#subjectString (readonly)

The email subject

Returns:

  • (String)

    the current value of subject



18
19
20
# File 'lib/mailtrap/email_template.rb', line 18

def subject
  @subject
end

#updated_atString (readonly)

The last update timestamp

Returns:

  • (String)

    the current value of updated_at



18
19
20
# File 'lib/mailtrap/email_template.rb', line 18

def updated_at
  @updated_at
end

#uuidString (readonly)

The template UUID

Returns:

  • (String)

    the current value of uuid



18
19
20
# File 'lib/mailtrap/email_template.rb', line 18

def uuid
  @uuid
end

Instance Method Details

#to_hHash

Returns The template attributes as a hash.

Returns:

  • (Hash)

    The template attributes as a hash



31
32
33
# File 'lib/mailtrap/email_template.rb', line 31

def to_h
  super.compact
end