Using the « Email Attachment Add-On » for adding File Attachments to Transactional Emails

Requires the SmtpPlus Email Attachments Add-On for SmtpPlus

Email Attachments is a Add-On to SmtpPlus for Magento and is available here...

Also update your SmtpPlus extension to Release 0.1.19 when wanting to use this Add-On.

Installation of the Email Attachments add-on for SmtpPlus is the same as for the SmtpPlus extension itself.

Email Attachments allows to add Files to the templates of Transactional Emails and all Product Types:

  • Files uploaded to the template of a Transactional Email get attached to each Email using the Template.
  • Files uploaded to a Product will get attached to each “New Order” Email where that product is part of the order.

A related configuration option allows to set a maximum total filesize for the Attachments, or to ZIP compress the Attachments.

Attachments exceeding the maximum total filesize may get included using a Template Block that will include a Download Link to each of the attached files (regardless if they are attached to the message or not). That way all attachments are always accessible for the Email recipient.

Email Attachments are also logged with SmtpPlus if the related configuration option is enabled.

The configuration Options of SmtpPlus are being extended by the following options:

Attachment Size Limit

Defines the Limit of Filesize total in Bytes, kB (add “kB”), MB (add “MB”), GB (add “GB”). Leave empty for no limit.

Before each Email is sent the total filesize of all attached files is checked against this limit. The priority for removing attachments in case the total filesize of all Email Attachments is exceeding this limit are “Product related Attachments” before “Template related Attachments”. That means that the last added Product related Attachment is removed, until the filesize limit is satisfied. After that the Template related Attachments are removed.

That allows to have the Template related Attachments in higher priority, than the Product ones.

To deliver the recipient an alternative method to access all collected attachments, use the Download Links Block.

Compress delivered Files using ZIP

Allows to compress each attachment using “ZIP” compression before Email delivery. The total filesize of the Attachments is calculated from the uncompressed original files. This option allows to further reduce the total message size of the Email.

To add Files as Email Attachments to the templates of Transactional Emails open the related Email Template (System » Transactional Emails), the Template Edit Page is extended to upload and title files as Attachments to use:

Use Browse to select a new file, use Upload to upload the file and attach it to the Email Template. The Title for each file is used in the Download Link Block that is also available to get used in the Email Template to access direct download of the Email Attachments from the email message.

As alternative way to access the Email Attachments you may add a template block to the template of the Transactional Email which will hold a download link to each of the Attachments added to the Email Message by the Add-On:

Use the following template code to add this block:

{{layout handle="smtpplusattachment_email_attachment_link"}}


To customize the block see the related template located in smtpplusattachment/email/attachment/link.phtml of the app/design/frontend/default/default/template directory. To add additional customized layouts of this block add a new block definition to a copy of layout/smtpplusattachment.xml in your frontend design directory, see the following example:

layout/smtpplusattachment.xml

<!-- Email Block with Attachment Download Links -->
    <smtpplusattachment_email_attachment_link>
    	<block type="smtpplusattachment/email_attachment_link" name="smtpplus_email_attachment_link" template="smtpplusattachment/email/attachment/link.phtml" />
    </smtpplusattachment_email_attachment_link>
 
<!-- Additional Email Block with Attachment Download Links -->
    <smtpplusattachment_email_attachment_link_custom>
    	<block type="smtpplusattachment/email_attachment_link" name="smtpplus_email_attachment_link" template="smtpplusattachment/email/attachment/link-custom.phtml" />
    </smtpplusattachment_email_attachment_link_custom>

Then use the additional block as shown above:

{{layout handle="smtpplusattachment_email_attachment_link_custom"}}



To add Files as Email Attachments to Products, and have these attached to the New Order Email if the product is part of the Order, edit the Product:

The tab Email Attachments allows to add product related Email Attachments:

Use Browse to select a new file, use Upload to upload the file and attach it to the Email for the product. The Title for each file is used in the Download Link Block that is also available to get used in the Email Template to access direct download of the Email Attachments from the transactional email message.

To make an Email Attachment also visible on the Product View Page, check Visible on Product View. The so selected Email Attachments will then be shown on the Catalogs Product View Page:

To customize the block see the related template located in smtpplusattachment/catalog/product/attachment.phtml of the app/design/frontend/default/default/template directory.