coldbox.system.core.mail.protocols

Class PostmarkProtocol

WEB-INF.cftags.component
        extended by coldbox.system.core.mail.AbstractProtocol
            extended by coldbox.system.core.mail.protocols.PostmarkProtocol
Class Attributes:
  • output : false
  •  

    A mail protocol that sends via http://postmarkapp.com/

    Constructor Summary
    init([any properties='[runtime expression]'])
          Constructor.
    Method Summary
    private struct encodeAttachment(struct MailParam)
         I encode an attachment so that PostMark likes it.
    private struct encodeHeader(struct MailParam)
         I encode named headers so that PostMark likes it.
    private string getFileMimeType(string filePath)
         I calculate the MIME type for a given file.
    private struct reformatPostMarkResponse(struct PostMarkReturnStruct)
         I format the PostMarkApp return result into one which conforms to the coldbox mailer service.
    struct send(Mail mail)
         Send an email payload.
     
    Methods inherited from class coldbox.system.core.mail.AbstractProtocol
    getProperties, getProperty, propertyExists, setProperties, setProperty
     
    Methods inherited from class WEB-INF.cftags.component
    None

    Constructor Detail

    init

    public init([any properties='[runtime expression]'])

    Constructor

    Parameters:
    properties - A map of configuration properties for the protocol

    Method Detail

    encodeAttachment

    private struct encodeAttachment(struct MailParam)

    I encode an attachment so that PostMark likes it.

    Parameters:
    MailParam - I'm the file path for the attachment.

    encodeHeader

    private struct encodeHeader(struct MailParam)

    I encode named headers so that PostMark likes it

    Parameters:
    MailParam - I'm the file path for the attachment.

    getFileMimeType

    private string getFileMimeType(string filePath)

    I calculate the MIME type for a given file.

    Parameters:
    filePath - I'm the path to the file to be tested.

    reformatPostMarkResponse

    private struct reformatPostMarkResponse(struct PostMarkReturnStruct)

    I format the PostMarkApp return result into one which conforms to the coldbox mailer service.

    Parameters:
    PostMarkReturnStruct - I'm the returned structure from postmark

    send

    public struct send(Mail mail)

    Send an email payload. Returns a struct: [error:boolean,errorArray:array,messageid:string]

    Overrides:
    send in class AbstractProtocol
    Parameters:
    mail - The mail payload to send.