PHP Class AcMailer\Controller\Plugin\SendMailPlugin

Author: Alejandro Celaya Alastrué
Inheritance: extends Zend\Mvc\Controller\Plugin\AbstractPlugin, implements AcMailer\Service\MailServiceAwareInterface
Datei anzeigen Open project: acelaya/zf2-acmailer Class Usage Examples

Protected Properties

Property Type Description
$mailService AcMailer\Service\MailServiceInterface

Public Methods

Method Description
__construct ( AcMailer\Service\MailServiceInterface $mailService )
__invoke ( null | string | Zend\View\Model\ViewModel | array $bodyOrConfig = null, null | string $subject = null, null | array $to = null, null | string | array $from = null, null | array $cc = null, null | array $bcc = null, null | array $attachments = null, null | array $replyTo = null, $encoding = null ) : AcMailer\Service\MailServiceInterface | AcMailer\Result\ResultInterface If no arguments are provided, the mail service is returned.
getMailService ( ) : AcMailer\Service\MailServiceInterface
setMailService ( AcMailer\Service\MailServiceInterface $mailService )

Protected Methods

Method Description
applyArgsToMailService ( array $args ) Applies the arguments provided while invoking this plugin to the MailService, discarding any previous configuration
applyArrayArgs ( array $args, string $key )
normalizeMailArgs ( array $args ) : array Normalizes the arguments passed when invoking this plugin so that they can be treated in a consistent way

Method Details

__construct() public method

public __construct ( AcMailer\Service\MailServiceInterface $mailService )
$mailService AcMailer\Service\MailServiceInterface

__invoke() public method

If any argument is provided, they will be used to configure the MailService and send an email. The result object will be returned in that case
public __invoke ( null | string | Zend\View\Model\ViewModel | array $bodyOrConfig = null, null | string $subject = null, null | array $to = null, null | string | array $from = null, null | array $cc = null, null | array $bcc = null, null | array $attachments = null, null | array $replyTo = null, $encoding = null ) : AcMailer\Service\MailServiceInterface | AcMailer\Result\ResultInterface
$bodyOrConfig null | string | Zend\View\Model\ViewModel | array
$subject null | string
$to null | array
$from null | string | array
$cc null | array
$bcc null | array
$attachments null | array
$replyTo null | array
return AcMailer\Service\MailServiceInterface | AcMailer\Result\ResultInterface

applyArgsToMailService() protected method

Applies the arguments provided while invoking this plugin to the MailService, discarding any previous configuration
protected applyArgsToMailService ( array $args )
$args array

applyArrayArgs() protected method

protected applyArrayArgs ( array $args, string $key )
$args array
$key string

getMailService() public method

public getMailService ( ) : AcMailer\Service\MailServiceInterface
return AcMailer\Service\MailServiceInterface

normalizeMailArgs() protected method

Normalizes the arguments passed when invoking this plugin so that they can be treated in a consistent way
protected normalizeMailArgs ( array $args ) : array
$args array
return array

setMailService() public method

public setMailService ( AcMailer\Service\MailServiceInterface $mailService )
$mailService AcMailer\Service\MailServiceInterface

Property Details

$mailService protected_oe property

protected MailServiceInterface,AcMailer\Service $mailService
return AcMailer\Service\MailServiceInterface