EmailFactory

Implements \EmailFactoryInterface

Class EmailFactory

category

System

package

Email

Methods

Class Constructor

__construct(\CI_DB_query_builder $db) 

Arguments

$db

\CI_DB_query_builder

Query builder.

Builds and returns the mailer settings.

_buildMailerSettings() : boolean|\EmailMailerSettings

Response

boolean|\EmailMailerSettings

Returns a database connection.

_getDbConnection() : \CI_DB_query_builder

Response

\CI_DB_query_builder

Database connection.

Returns a new string type.

_string( $string) : \StringType

Arguments

$string

String to be represented.

Response

\StringType

Creates an email attachment object

createAttachment(\AttachmentPathInterface $path, \AttachmentNameInterface $name = null) : \EmailAttachment

Arguments

$path

\AttachmentPathInterface

Valid path of the attachment (on the server).

$name

\AttachmentNameInterface

(optional) Display name for the attachment.

Response

\EmailAttachment

The created email attachment.

Creates an attachments handler object

createAttachmentsHandler(string $p_uploadsDirPath = null) : \AttachmentsHandler

Arguments

$p_uploadsDirPath

string

(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.

Response

\AttachmentsHandler

The created attachments handler.

Creates an email contact object

createContact(\EmailAddressInterface $emailAddress, \ContactTypeInterface $contactType, \ContactNameInterface $contactName = null) : \EmailContact

Arguments

$emailAddress

\EmailAddressInterface

Email address of the contact.

$contactType

\ContactTypeInterface

Contact type (see ContactType class definition).

$contactName

\ContactNameInterface

(optional) Contact display name.

Response

\EmailContact

The created email contact.

Creates email deleter object

createDeleter() : \EmailDeleter

Response

\EmailDeleter

The created email deleter.

Creates an email object

createEmail(\IdType $id = null, \EmailSubjectInterface $subject = null, \EmailContentInterface $contentHtml = null, \EmailContentInterface $contentPlain = null, boolean $p_isPending = true, \ContactCollectionInterface $contacts = null, \AttachmentCollectionInterface $attachments = null) : \Email
Throws
\InvalidArgumentException

If '$p_isPending' is not a bool, or if any other argument is not valid.

\UnexpectedValueException

If the contact type was not found

Arguments

$id

\IdType

(optional) E-Mail ID.

$subject

\EmailSubjectInterface

(optional) E-Mail subject.

$contentHtml

\EmailContentInterface

(optional) E-Mail HTML content.

$contentPlain

\EmailContentInterface

(optional) E-Mail plain content.

$p_isPending

boolean

(optional) E-Mail is pending?

$contacts

\ContactCollectionInterface

(optional) E-Mail contacts.

$attachments

\AttachmentCollectionInterface

(optional) E-Mail attachments.

Response

\Email

The created email.

Creates a PHP mailer object.

createMailer(string $protocol = null, \EmailMailerSettings|null $mailerSettings = null) : \PHPMailer\PHPMailer\PHPMailer

Arguments

$protocol

string

(Optional) Provide 'smtp', 'sendmail' or 'mail' if you want to override the EMAIL_TRANSPORT constant.

$mailerSettings

\EmailMailerSettings|null

(Optional) settings value object for mailer.

Response

\PHPMailer\PHPMailer\PHPMailer

The created PHP mailer.

Creates a mailer adapter object

createMailerAdapter() : \MailerAdapter

Response

\MailerAdapter

The created mailer adapter.

Creates a PHP Punycode encoder instance.

createPunycodeEncoder() : \TrueBV\Punycode
link

https://github.com/true/php-punycode

Response

\TrueBV\Punycode

Create EmailReader Object

createReader() : \EmailReader

Response

\EmailReader

The created email deleter.

Creates an email repository object

createRepository() : \EmailRepository

Response

\EmailRepository

The created email repository.

Creates an email service object

createService() : \EmailService

Response

\EmailService

The created email service.

Creates an email writer object

createWriter() : \EmailWriter

Response

\EmailWriter

The created email writer.

Properties

Query builder.

db : \CI_DB_query_builder
var

Type(s)

\CI_DB_query_builder

mailerSettings

mailerSettings : \EmailMailerSettings
var

Type(s)

\EmailMailerSettings