EmailHeaderRepresentable
public protocol EmailHeaderRepresentable
The EmailHeaderRepresentable protocol provides a method for ensuring
custom headers are valid.
-
A dictionary representing the headers that should be added to the email.
Declaration
Swift
var headers: [String : String]? { get set } -
validateHeaders()Default implementationValidates the
headersproperty to ensure they are not using any reserved headers. If there is a problem, an error is thrown. If everything is fine, then this method returns nothing.Throws
If there is an invalid header, an error will be thrown.Default Implementation
The default implementation validates against the following headers:
- X-SG-ID
- X-SG-EID
- Received
- DKIM-Signature
- Content-Type
- Content-Transfer-Encoding
- To
- From
- Subject
- Reply-To
- CC
- BCC
Declaration
Swift
func validateHeaders() throws
View on GitHub
EmailHeaderRepresentable Protocol Reference