Overview

Packages

  • blesta
    • app
      • controllers
      • models
    • components
      • auth
        • ldap
        • motp
        • oath
      • delivery
        • interfax
        • postal
          • methods
      • download
      • email
      • events
      • exchange
        • rates
          • currency
            • layer
          • fixer
          • open
            • exchange
              • rates
          • x
            • rates
      • gateway
        • payments
      • gateways
      • invoice
        • delivery
        • templates
          • perforated
            • invoice
          • quickbooks
            • invoice
          • templates
            • default
      • modules
      • net
        • amazon
          • s3
        • http
        • net
          • geo
            • ip
      • plugins
      • reports
        • aging
          • invoices
        • client
          • data
            • portability
        • custom
          • report
        • invoice
          • creation
        • package
          • revenue
        • tax
          • liability
        • transactions
          • applied
          • received
      • security
      • session
        • cart
      • settingscollection
      • upgrades
        • tasks
      • upload
      • vcard
    • core
      • Automation
        • Tasks
          • Common
          • Task
        • Type
          • Common
          • Cron
      • Pricing
        • ItemComparator
        • MetaItem
        • Modifier
          • Type
            • Description
              • Type
                • Discount
                • Option
                • Service
                • Tax
            • Discount
            • Price
            • Proration
        • Presenter
          • Build
            • Invoice
            • InvoiceData
            • Options
            • Service
            • ServiceChange
            • ServiceData
          • Collection
          • Format
            • Fields
            • Type
              • Discount
              • Item
              • Option
              • Options
              • Package
              • Pricing
              • Service
              • Tax
          • Items
            • Invoice
            • Service
          • Type
      • ServiceProviders
      • Util
        • Captcha
          • Captchas
          • Common
        • Common
          • Traits
        • Events
          • Common
          • Handlers
          • Observers
        • Filters
          • Common
        • GeoIp
        • Input
          • Fields
            • Common
        • Tax
        • Widgets
    • helpers
      • currency
        • format
      • data
        • structure
          • array
          • string
      • text
        • parser
      • widget
        • client
  • minPHP
    • helpers
      • color
      • data
        • structure
  • None
  • PHP

Classes

  • Email
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated

Class Email

A wrapper component for Swift Mailer, adds tag replacements capabilities.

Package: blesta\components\email
Copyright: Copyright (c) 2010, Phillips Data, Inc.
License: The Blesta License Agreement
Link: Blesta
Located at components/email/email.php
Methods summary
public
# __construct( string $charset = 'UTF-8', integer $max_line_length = 1000 )

Constructs a new Email components, sets the default charset.

Constructs a new Email components, sets the default charset.

Parameters

$charset
The default character set encoding.
$max_line_length
The maximum line length (historically 78 chars, no more than 1000 per RFC 2822)
public
# setTransport( Swift_Transport $transport )

Sets the transport object to be used for all subsequent requests

Sets the transport object to be used for all subsequent requests

Parameters

$transport
transport object used to send the message (SMTP, Sendmail, Mail, etc.)
public
# setFloodResistance( integer $max_messages, integer $pause_time = 0 )

Set the flood resistance for sending messages

Set the flood resistance for sending messages

Parameters

$max_messages

The maximum number of messages to send before disconnecting/reconnecting to the mail server

$pause_time
The number of seconds to pause before reconnecting
public
# setLogOptions( array $options )

Sets the log options to be recorded when the message is attempted

Sets the log options to be recorded when the message is attempted

Parameters

$options

An array of options to log when this message is attempted to be sent including:

  • company_id The ID of the company the message is being sent by
  • to_client_id The ID of the client the message is being sent to (optional)
  • from_staff_id The ID of the staff member the message is sent by (optional)
  • log Bool true or false, whether to log the email (optional, default true)
public
# setTags( array $tags )

Sets the given array of tags for replacement.

Sets the given array of tags for replacement.

Parameters

$tags
The tags to set for replacement.

See

Email::replaceTags()
public
# setSubject( string $subject, array $replacements = [] )

Sets the subject of the message, replacing the given tags with their key/value pairs.

Sets the subject of the message, replacing the given tags with their key/value pairs.

Parameters

$subject
The subject of the message
$replacements
The key/value pairs of tag replacements

See

Email::setTags()
public
# setBody( string $body, boolean $is_html = false, array $replacements = [] )

Sets the body of the message, replacing the given tags with their key/value pairs.

Sets the body of the message, replacing the given tags with their key/value pairs.

Parameters

$body
The body of the message
$is_html
True if $body is HTML, false otherwise
$replacements
The key/value pairs of tag replacements

See

Email::setTags()
public
# setAltBody( string $body, array $replacements = [] )

Sets the alternate body of the message, replacing the given tags with their key/value pairs.

Sets the alternate body of the message, replacing the given tags with their key/value pairs.

Parameters

$body
The body of the message
$replacements
The key/value pairs of tag replacements

See

Email::setTags()
public
# setLogBody( stdClass $body, array $replacements = [] )

Sets an alternate body for logging purposes, replacing the given tags with their key/value pairs.

Sets an alternate body for logging purposes, replacing the given tags with their key/value pairs.

Parameters

$body
The masked email containing the body of the message
$replacements
The key/value pairs of tag replacements

See

Email::setTags()
public
# setFrom( string $from, string $from_name = null )

Invokes parent::SetFrom()

Invokes parent::SetFrom()

Parameters

$from
The from address
$from_name
The from name for this from address
public
# addAddress( string $address, string $name = null )

Invokes parent::AddAddress()

Invokes parent::AddAddress()

Parameters

$address
The email address to add as a TO address
$name
The TO name
public
# addCc( string $address, string $name = null )

Invokes parent::AddCC()

Invokes parent::AddCC()

Parameters

$address
The email address to add as a CC address
$name
The CC name
public
# addBcc( string $address, string $name = '' )

Invokes parent::AddBCC()

Invokes parent::AddBCC()

Parameters

$address
The email address to add as a BCC address
$name
The BCC name
public
# addReplyTo( string $address, string $name = null )

Invokes parent::setReplyTo()

Invokes parent::setReplyTo()

Parameters

$address
The email address to add as a ReplyTo address
$name
The ReplyTo name
public
# addAttachment( string $path, string $name, string $encoding, string $type )

Adds the attachment

Adds the attachment

Parameters

$path
The path to the file
$name
The name of the file
$encoding
The encoding of the file
$type
The MIME type of the file
public
# send( )

Invokes parent::Send() and logs the result

Invokes parent::Send() and logs the result

protected
# log( array $vars )

Log the last sent message to the Logs

Log the last sent message to the Logs

Parameters

$vars

A key/value array of data to log, including:

  • log If false, will not log the email
    • Any other fields to log
public
# resetAll( )

Resets all recipients, replytos, attachments, and custom headers, body and subject, and replacement tags (if any).

Resets all recipients, replytos, attachments, and custom headers, body and subject, and replacement tags (if any).

Properties summary
public string $tag_start

The left tag enclosure

The left tag enclosure

# '['
public string $tag_end

The right tag enclosure

The right tag enclosure

# ']'
public Logs $Logs

The logs Model, used to record outgoing messages

The logs Model, used to record outgoing messages

#
Blesta API documentation generated by ApiGen