The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Email::Assets - Manage assets for Email

ATTRIBUTES

mime_types

MIME::Types object

cid

inline_only

boolean flag, allows you to attach only appropriate assets to a mail

base_paths

arrayref of where to look for files

relative_filename

relative path and filename for a file

METHODS

filename

Object accessor method, returns full filename and path (which may not exist if the asset was created from data instead of a file).

mime_type

Object accessor method, returns MIME type / content-type of the asset

BUILD

moose method called by constructor, handles validating path to file

inline_data

Object method to get file as inline-data string, including content type and base64 encoded file contents

<img src="data:[% assets.include('static/foo.gif', {inline_only => 1}).inline_data -%]">

See wikipedia reference in SEE ALSO for details on limited support & pro/cons of using inline data over cid

file_as_base64

Object method to get file contents encoded in base64

as_mime_part

Object method to get file as a MIME::Lite object, takes optional hashref of arguments, arguments are : content_disposition which defaults to attachment.

not_inline_only

Object accessor method, returns opposite to inline_only

SEE ALSO

http://en.wikipedia.org/wiki/Data_URI_scheme#Email_Client_support
http://stackoverflow.com/a/23853079
MIME::Lite
MIME::Base46

AUTHOR

Aaron J Trevena, <teejay at cpan.org>