EmailFactory
in package
implements
EmailFactoryInterface
Class EmailFactory
Tags
Interfaces, Classes and Traits
- EmailFactoryInterface
- Interface EmailFactoryInterface
Table of Contents
- $db : CI_DB_query_builder
- Query builder.
- $mailerSettings : EmailMailerSettings
- __construct() : mixed
- Class Constructor
- createAttachment() : EmailAttachment
- Creates an email attachment object
- createAttachmentsHandler() : AttachmentsHandler
- Creates an attachments handler object
- createContact() : EmailContact
- Creates an email contact object
- createDeleter() : EmailDeleter
- Creates email deleter object
- createEmail() : Email
- Creates an email object
- createMailer() : PHPMailer
- Creates a PHP mailer object.
- createMailerAdapter() : MailerAdapter
- Creates a mailer adapter object
- createPunycodeEncoder() : Punycode
- Creates a PHP Punycode encoder instance.
- createReader() : EmailReader
- Create EmailReader Object
- createRepository() : EmailRepository
- Creates an email repository object
- createService() : EmailService
- Creates an email service object
- createWriter() : EmailWriter
- Creates an email writer object
- _buildMailerSettings() : bool|EmailMailerSettings
- Builds and returns the mailer settings.
- _getDbConnection() : CI_DB_query_builder
- Returns a database connection.
- _string() : StringType
- Returns a new string type.
Properties
$db
Query builder.
protected
CI_DB_query_builder
$db
$mailerSettings
protected
EmailMailerSettings
$mailerSettings
Methods
__construct()
Class Constructor
public
__construct(CI_DB_query_builder $db) : mixed
Parameters
- $db : CI_DB_query_builder
-
Query builder.
Return values
mixed —createAttachment()
Creates an email attachment object
public
createAttachment(AttachmentPathInterface $path[, AttachmentNameInterface $name = null ]) : EmailAttachment
Parameters
- $path : AttachmentPathInterface
-
Valid path of the attachment (on the server).
- $name : AttachmentNameInterface = null
-
(optional) Display name for the attachment.
Return values
EmailAttachment —The created email attachment.
createAttachmentsHandler()
Creates an attachments handler object
public
createAttachmentsHandler([string $p_uploadsDirPath = null ]) : AttachmentsHandler
Parameters
- $p_uploadsDirPath : string = null
-
(optional) You can specify a custom uploads directory path if you do not want the default "uploads" directory. The path must contain a "tmp" and an "attachments" directory otherwise the AttachmentsHandler class will not work properly.
Return values
AttachmentsHandler —The created attachments handler.
createContact()
Creates an email contact object
public
createContact(EmailAddressInterface $emailAddress, ContactTypeInterface $contactType[, ContactNameInterface $contactName = null ]) : EmailContact
Parameters
- $emailAddress : EmailAddressInterface
-
Email address of the contact.
- $contactType : ContactTypeInterface
-
Contact type (see ContactType class definition).
- $contactName : ContactNameInterface = null
-
(optional) Contact display name.
Return values
EmailContact —The created email contact.
createDeleter()
Creates email deleter object
public
createDeleter() : EmailDeleter
Return values
EmailDeleter —The created email deleter.
createEmail()
Creates an email object
public
createEmail([IdType $id = null ][, EmailSubjectInterface $subject = null ][, EmailContentInterface $contentHtml = null ][, EmailContentInterface $contentPlain = null ][, bool $p_isPending = true ][, ContactCollectionInterface $contacts = null ][, AttachmentCollectionInterface $attachments = null ]) : Email
Parameters
- $id : IdType = null
-
(optional) E-Mail ID.
- $subject : EmailSubjectInterface = null
-
(optional) E-Mail subject.
- $contentHtml : EmailContentInterface = null
-
(optional) E-Mail HTML content.
- $contentPlain : EmailContentInterface = null
-
(optional) E-Mail plain content.
- $p_isPending : bool = true
-
(optional) E-Mail is pending?
- $contacts : ContactCollectionInterface = null
-
(optional) E-Mail contacts.
- $attachments : AttachmentCollectionInterface = null
-
(optional) E-Mail attachments.
Tags
Return values
Email —The created email.
createMailer()
Creates a PHP mailer object.
public
createMailer([string $protocol = null ][, EmailMailerSettings|null $mailerSettings = null ]) : PHPMailer
Parameters
- $protocol : string = null
-
(Optional) Provide 'smtp', 'sendmail' or 'mail' if you want to override the EMAIL_TRANSPORT constant.
- $mailerSettings : EmailMailerSettings|null = null
-
(Optional) settings value object for mailer.
Return values
PHPMailer —The created PHP mailer.
createMailerAdapter()
Creates a mailer adapter object
public
createMailerAdapter() : MailerAdapter
Return values
MailerAdapter —The created mailer adapter.
createPunycodeEncoder()
Creates a PHP Punycode encoder instance.
public
createPunycodeEncoder() : Punycode
Tags
Return values
Punycode —createReader()
Create EmailReader Object
public
createReader() : EmailReader
Return values
EmailReader —The created email deleter.
createRepository()
Creates an email repository object
public
createRepository() : EmailRepository
Return values
EmailRepository —The created email repository.
createService()
Creates an email service object
public
createService() : EmailService
Return values
EmailService —The created email service.
createWriter()
Creates an email writer object
public
createWriter() : EmailWriter
Return values
EmailWriter —The created email writer.
_buildMailerSettings()
Builds and returns the mailer settings.
protected
_buildMailerSettings() : bool|EmailMailerSettings
Return values
bool|EmailMailerSettings —_getDbConnection()
Returns a database connection.
protected
_getDbConnection() : CI_DB_query_builder
Return values
CI_DB_query_builder —Database connection.
_string()
Returns a new string type.
protected
_string( $string) : StringType