Interface EmailServiceInterface
Interface EmailServiceInterface
Methods summary
public
create( EmailContactInterface $sender, EmailContactInterface $recipient, EmailSubjectInterface $subject, EmailContentInterface $content = null )
: EmailInterface
Creates a new email
Use this method to can a valid email object that can be sent without any
additional modification. Optionally you can add more information to the
email object such as attachments, BCC & CC contacts etc.
Parameters
$sender
- Contains the sender information.
$recipient
- Contains the recipient information.
$subject
- Email record subject.
$content
- (optional) Html content of the email.
Returns
public
send( EmailInterface $email )
Sends and saves an email.
Sends and saves an email.
Parameters
$email
- Contains email information.
public
queue( EmailInterface $email )
Saves an email as pending (will not be sent).
Saves an email as pending (will not be sent).
Parameters
$email
- Contains email information.
public
write( EmailInterface $email )
Writes an email instance to the DB.
Writes an email instance to the DB.
This method will store an email entity just the way it is without modifying other properties
like the "send" or "queue" methods do. If you use this method or the "writeCollection" make
sure that all the email properties are the desired ones.
Parameters
public
getById( IdType $id )
: EmailInterface
Returns an email by id.
Parameters
$id
- The database ID that matches the email record.
Returns
public
delete( EmailInterface $email )
Removes an email from the database.
Removes an email from the database.
Parameters
$email
- Contains the email information.
public
filter( string $p_keyword, array $limit = array(), array $order = array() )
: EmailCollection
Filters email records with provided keyword string.
Filters email records with provided keyword string.
Parameters
$p_keyword
- String to be used for filtering the email records.
$limit
(optional) Array that contains LIMIT and OFFSET value
e.g. array( 'limit' => 10, 'offset' => 5 )
$order
(optional) Contains arrays with column, direction pairs
e.g. array( 'column' => 'direction' )
Returns
public
validateEmailAddress( string $p_emailAddress )
: boolean
Validate a string email address.
Validate a string email address.
Parameters
$p_emailAddress
- Email address to be validated.
Returns
boolean
Returns the validation result (true for success, false for failure).
public
sendPending( void )
Sends pending email records.
Sends pending email records.
public
getSent( void )
: EmailCollectionInterface
Returns sent email records as an email collection.
Returns sent email records as an email collection.
Returns
public
getAll( void )
: EmailCollection
Returns all email records from the database.
Returns all email records from the database.
Returns
public
writeCollection( EmailCollectionInterface $collection )
Writes a collection of emails into database.
Writes a collection of emails into database.
Parameters
$collection
- Email collection to write.
public
getRecordCount( string $p_filterKeyword = '' )
: integer
Returns the current count of the email records in the database.
Returns the current count of the email records in the database.
Parameters
$p_filterKeyword
- (optional) If provided the records will be filtered.
Returns
integer
The row number of the email table.
public
deleteEmailsByCustomerEmail( CustomerEmail $email )
Removes all emails from the data base that have the given email address as sender or recipient.
Removes all emails from the data base that have the given email address as sender or recipient.
Parameters
public
getEmailsByCustomerEmail( CustomerEmail $email )
: EmailCollection
Gets all emails from the data base that have the given email address as sender or recipient.
Gets all emails from the data base that have the given email address as sender or recipient.
Parameters
Returns