Class Magentron_EmailImages_Helper_Data

Description

Magentron EmailImages Extension

Located in /Magentron/EmailImages/Helper/Data.php (line 11)

Mage_Core_Helper_Abstract
   |
   --Magentron_EmailImages_Helper_Data
Class Constant Summary
CACHE_TAG = 'MAGENTRON_EMAILIMAGES'
CACHE_TYPE = 'emailimages'
DEFAULT_REGEXP = '/((<[iI][mM][gG] [^>]*[sS][rR][cC]|[Bb][Aa][Cc][Kk][Gg][Rr][Oo][Uu][Nn][Dd])="|image:url\(\'?)([^\'"\)]*)(["\'\)])/'
XML_EMAIL_IMAGES_CACHE_TIME = 'system/emailimages/cache_time'
XML_EMAIL_IMAGES_ENABLE = 'system/emailimages/enable'
XML_EMAIL_IMAGES_REGEXP = 'system/emailimages/regexp'
XML_EMAIL_IMAGES_REGEXP_INDEX = 'system/emailimages/regexp_index'
Method Summary
void addImages (Zend_Mail $mail, [string $context = null])
integer getCacheTime ()
boolean isEnabled ()
void _attachImageUrls (Zend_Mail $mail, array $urls)
string|false _getBodyHtml (Zend_Mail $mail)
array _getContextDataFromCache (string $context_cache_id)
array _getImageUrlsFromBodyHtml (string $bodyHtml)
array _getImageUrlsFromMail (Zend_Mail $mail, [string $context = null])
array|false _retrieveImageData (string $url)
void _saveContextDataToCache (string $context_cache_id, boolean $isHtml, array $urls)
Methods
addImages (line 142)

Attach images to mail object.

void addImages (Zend_Mail $mail, [string $context = null])
  • Zend_Mail $mail: Zend_Mail instance to attach images to.
  • string $context: [optional] Set to unique identifier for template, so that body needs to be parsed only once per template (NB: case-insensitive).
cleanCache (line 173)

Remove cached image and context data from the cache.

getCacheTime (line 87)

Retrieve the maximum lifetime for caching in seconds.

integer getCacheTime ()
getRegularExpression (line 105)

Retrieve the regular expression to extract the image URLs from the email HTML body.

string getRegularExpression ()
getRegularExpressionIndex (line 123)

Retrieve the index in the regular expression matches to extract the image URLs from the email HTML body.

integer getRegularExpressionIndex ()
isEnabled (line 74)

Is the EmailImages extension enabled to actually attach images?

boolean isEnabled ()
_attachImageUrls (line 367)

Attach image URLs to the email.

void _attachImageUrls (Zend_Mail $mail, array $urls)
  • Zend_Mail $mail: Zend_Mail instance to attach images to.
  • array $urls: Array of image URLs to attach.
_getBodyHtml (line 299)

Retrieve HTML body from mail object.

string|false _getBodyHtml (Zend_Mail $mail)
  • Zend_Mail $mail: Mail object instance to use.
_getContextDataFromCache (line 276)

Retrieve cached context data.

  • return: Array containing keys 'isHtml' to indicate a HTML body, 'urls' for image URLs from that HTML body.
  • see: Mage_Core::_Model_Cache()
  • access: protected
array _getContextDataFromCache (string $context_cache_id)
  • string $context_cache_id: Cached context data cache ID.
_getImageUrlsFromBodyHtml (line 240)

Retrieve image URL from email body HTML

array _getImageUrlsFromBodyHtml (string $bodyHtml)
  • string $bodyHtml: Email body HTML to use.
_getImageUrlsFromMail (line 193)

Retrieve image URLs from email content

array _getImageUrlsFromMail (Zend_Mail $mail, [string $context = null])
  • Zend_Mail $mail: Zend_Mail instance to attach images to.
  • string $context: [optional] Set to unique identifier for template, so that body needs to be parsed only once per template (NB: case-insensitive).
_retrieveImageData (line 417)

Retrieve image data from URL.

NB: uses file_get_contents().

array|false _retrieveImageData (string $url)
  • string $url: URL to retrieve image data from.
_saveContextDataToCache (line 338)

Save context data to cache.

void _saveContextDataToCache (string $context_cache_id, boolean $isHtml, array $urls)
  • string $context_cache_id: Cache ID to use.
  • boolean $isHtml: Set to true if email body is HTML.
  • array $urls: Array of image URLs from HTML body.
Class Constants
CACHE_TAG = 'MAGENTRON_EMAILIMAGES' (line 59)

Cache tag to use.

CACHE_TYPE = 'emailimages' (line 64)

Cache type to use.

DEFAULT_CACHE_TIME = 86400 (line 42)

Default maximum lifetime used for cache.

DEFAULT_REGEXP = '/((<[iI][mM][gG] [^>]*[sS][rR][cC]|[Bb][Aa][Cc][Kk][Gg][Rr][Oo][Uu][Nn][Dd])="|image:url\(\'?)([^\'"\)]*)(["\'\)])/' (line 48)

Default regular expression to extract image URLs from the email HTML body.

DEFAULT_REGEXP_INDEX = 3 (line 54)

Default index in the regular expression matches to extract the image URLs from the email HTML body.

XML_EMAIL_IMAGES_CACHE_TIME = 'system/emailimages/cache_time' (line 23)

Configuration path for maximum cache lifetime.

XML_EMAIL_IMAGES_ENABLE = 'system/emailimages/enable' (line 17)

Configuration path for extension enablement.

XML_EMAIL_IMAGES_REGEXP = 'system/emailimages/regexp' (line 29)

Configuration path for regular expression used to find image URLs in HTML.

XML_EMAIL_IMAGES_REGEXP_INDEX = 'system/emailimages/regexp_index' (line 36)

Configuration path for index into matches of regular expression used to find image URLs in HTML.

Documentation generated on Fri, 09 Oct 2015 03:37:09 +0200 by phpDocumentor 1.4.4