Content
public struct Content : Encodable
The Content class represents a MIME part of the email message (i.e. the
plain text and HTML parts of an email).
-
The content type of the content.
Declaration
Swift
public let type: ContentType -
The value of the content.
Declaration
Swift
public let value: String
-
Initializes the content with a content type and value.
Declaration
Swift
public init(contentType: ContentType, value aValue: String)Parameters
contentTypeThe content type.
aValueThe value of the content.
-
Validates the content.
Declaration
Swift
public func validate() throws
-
Creates a new
Contentinstance used to represent a plain text body.Declaration
Swift
public static func plainText(body value: String) -> ContentParameters
valueThe plain text value of the body.
Return Value
A
Contentinstance with thetext/plain
content type. -
Creates a new
Contentinstance used to represent an HTML body.Declaration
Swift
public static func html(body value: String) -> ContentParameters
valueThe HTML text value of the body.
Return Value
A
Contentinstance with thetext/html
content type. -
Return an array containing a plain text and html body.
Declaration
Swift
public static func emailBody(plain: String, html: String) -> [Content]Parameters
plainThe text value for the plain text body.
htmlThe HTML text value for the HTML body.
Return Value
An array of
Contentinstances.
View on GitHub
Content Structure Reference