Documentation ¶
Index ¶
- type Base64Buffer
- type EmbeddedBinaryObject
- func FileAttachmentFromFile(filePath string) (*EmbeddedBinaryObject, error)
- func FileAttachmentFromReader(filename string, reader io.Reader) (*EmbeddedBinaryObject, error)
- func InlineImageFromFile(imageName string, imagePath string) (*EmbeddedBinaryObject, error)
- func InlineImageFromPath(imagePath string) (*EmbeddedBinaryObject, error)
- func InlineImageFromReader(imageName string, reader io.Reader) (*EmbeddedBinaryObject, error)
- func NewEmbeddedBinaryObject() *EmbeddedBinaryObject
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Base64Buffer ¶
Represents a buffer that holds base64 encoded information.
type EmbeddedBinaryObject ¶
type EmbeddedBinaryObject struct { // Filename is the name of the attachment or image. Filename string // Data is the base64 encoded data for this attachment or image. Data Base64Buffer // MimeType stores the MIME type detected for this file based upon it's filename extension. MIMEType mime.Type }
EmbeddedBinaryObject contains the data necessary to attach a file or embed an image into an email.
func FileAttachmentFromFile ¶
func FileAttachmentFromFile(filePath string) (*EmbeddedBinaryObject, error)
FileAttachmentFromFile will return a EmbeddedBinaryObject based upon the file path provided.
func FileAttachmentFromReader ¶
func FileAttachmentFromReader(filename string, reader io.Reader) (*EmbeddedBinaryObject, error)
FileAttachmentFromReader will return a EmbeddedBinaryObject based upon the data provided and provided filename. Filename is the name of the file to be attached, not the path to a file.
func InlineImageFromFile ¶
func InlineImageFromFile(imageName string, imagePath string) (*EmbeddedBinaryObject, error)
InlineImageFromFile will return an EmbeddedBinaryObject based upon the file path provided. The imageName is the value used in the <img src=” /> tags in the corresponding HTML body. It is recommended this is the actual file's name so that the MIME type can be properly detected.
func InlineImageFromPath ¶
func InlineImageFromPath(imagePath string) (*EmbeddedBinaryObject, error)
InlineImageFromPath will return an EmbeddedBinaryObject based upon the file path provided. The name of the image will be inferred from it's filename.
func InlineImageFromReader ¶
func InlineImageFromReader(imageName string, reader io.Reader) (*EmbeddedBinaryObject, error)
InlineImageFromReader will return an EmbeddedBinaryObject based upon the data provided. The imageName is the value used in the <img src=” /> tags in the corresponding HTML body. It is recommended this is the actual file's name so that the MIME type can be properly detected.
func NewEmbeddedBinaryObject ¶
func NewEmbeddedBinaryObject() *EmbeddedBinaryObject