PHP 클래스 AcMailer\Service\MailService

저자: Alejandro Celaya Alastrué
상속: implements AcMailer\Service\MailServiceInterface, implements Zend\EventManager\EventManagerAwareInterface, implements AcMailer\Event\MailListenerAwareInterface
파일 보기 프로젝트 열기: acelaya/zf2-acmailer 1 사용 예제들

공개 메소드들

메소드 설명
__construct ( Zend\Mail\Message $message, Zend\Mail\Transport\TransportInterface $transport, Zend\View\Renderer\RendererInterface $renderer ) Creates a new MailService
addAttachment ( string $path, string | null $filename = null )
addAttachments ( array $paths )
attachMailListener ( AcMailer\Event\MailListenerInterface $mailListener, integer $priority = 1 ) : mixed | void Attaches a new MailListenerInterface
detachMailListener ( AcMailer\Event\MailListenerInterface $mailListener ) Detaches provided MailListener
getAttachments ( ) : array Returns the list of attachments
getEventManager ( ) : Zend\EventManager\EventManagerInterface Retrieve the event manager Lazy-loads an EventManager instance if none registered.
getMessage ( ) : Zend\Mail\Message Returns this service's message
getRenderer ( ) : Zend\View\Renderer\RendererInterface Returns the renderer object that will be used to render templates
getTransport ( ) : Zend\Mail\Transport\TransportInterface Returns the transport object that will be used to send the wrapped message
send ( ) : AcMailer\Result\ResultInterface Sends the mail
setAttachments ( array $paths )
setBody ( Zend\Mime\Part | Zend\Mime\Message | string $body, string $charset = null ) Sets the message body
setDefaultLayout ( AcMailer\View\DefaultLayoutInterface $layout = null ) : mixed Sets the default layout to be used with all the templates set when calling setTemplate.
setEventManager ( Zend\EventManager\EventManagerInterface $events ) Inject an EventManager instance
setRenderer ( Zend\View\Renderer\RendererInterface $renderer )
setSubject ( string $subject ) Sets the message subject
setTemplate ( string | Zend\View\Model\ViewModel $template, array $params = [] ) Sets the body of this message from a template
setTransport ( Zend\Mail\Transport\TransportInterface $transport )

보호된 메소드들

메소드 설명
attachFiles ( ) Attaches files to the message if any
createMailEvent ( string $name = MailEvent::EVENT_MAIL_PRE_SEND, AcMailer\Result\ResultInterface $result = null ) : AcMailer\Event\MailEvent Creates a new MailEvent object
createMailResultFromException ( Exception $e ) : AcMailer\Result\MailResult Creates a error MailResult from an exception
renderChildren ( Zend\View\Model\ViewModel $model ) Renders template childrens.

메소드 상세

__construct() 공개 메소드

Creates a new MailService
public __construct ( Zend\Mail\Message $message, Zend\Mail\Transport\TransportInterface $transport, Zend\View\Renderer\RendererInterface $renderer )
$message Zend\Mail\Message
$transport Zend\Mail\Transport\TransportInterface
$renderer Zend\View\Renderer\RendererInterface Renderer used to render templates, typically a PhpRenderer

addAttachment() 공개 메소드

public addAttachment ( string $path, string | null $filename = null )
$path string
$filename string | null

addAttachments() 공개 메소드

public addAttachments ( array $paths )
$paths array

attachFiles() 보호된 메소드

Attaches files to the message if any
protected attachFiles ( )

attachMailListener() 공개 메소드

Attaches a new MailListenerInterface
public attachMailListener ( AcMailer\Event\MailListenerInterface $mailListener, integer $priority = 1 ) : mixed | void
$mailListener AcMailer\Event\MailListenerInterface
$priority integer
리턴 mixed | void

createMailEvent() 보호된 메소드

Creates a new MailEvent object
protected createMailEvent ( string $name = MailEvent::EVENT_MAIL_PRE_SEND, AcMailer\Result\ResultInterface $result = null ) : AcMailer\Event\MailEvent
$name string
$result AcMailer\Result\ResultInterface
리턴 AcMailer\Event\MailEvent

createMailResultFromException() 보호된 메소드

Creates a error MailResult from an exception
protected createMailResultFromException ( Exception $e ) : AcMailer\Result\MailResult
$e Exception
리턴 AcMailer\Result\MailResult

detachMailListener() 공개 메소드

Detaches provided MailListener
public detachMailListener ( AcMailer\Event\MailListenerInterface $mailListener )
$mailListener AcMailer\Event\MailListenerInterface

getAttachments() 공개 메소드

Returns the list of attachments
public getAttachments ( ) : array
리턴 array

getEventManager() 공개 메소드

Retrieve the event manager Lazy-loads an EventManager instance if none registered.
public getEventManager ( ) : Zend\EventManager\EventManagerInterface
리턴 Zend\EventManager\EventManagerInterface

getMessage() 공개 메소드

Returns this service's message
또한 보기: AcMailer\Service\MailServiceInterface::getMessage()
public getMessage ( ) : Zend\Mail\Message
리턴 Zend\Mail\Message

getRenderer() 공개 메소드

Returns the renderer object that will be used to render templates
public getRenderer ( ) : Zend\View\Renderer\RendererInterface
리턴 Zend\View\Renderer\RendererInterface

getTransport() 공개 메소드

Returns the transport object that will be used to send the wrapped message
public getTransport ( ) : Zend\Mail\Transport\TransportInterface
리턴 Zend\Mail\Transport\TransportInterface

renderChildren() 보호된 메소드

Inspired on Zend\View\View implementation to recursively render child models
또한 보기: Zend\View\View::renderChildren
protected renderChildren ( Zend\View\Model\ViewModel $model )
$model Zend\View\Model\ViewModel

send() 공개 메소드

Sends the mail
public send ( ) : AcMailer\Result\ResultInterface
리턴 AcMailer\Result\ResultInterface

setAttachments() 공개 메소드

public setAttachments ( array $paths )
$paths array

setBody() 공개 메소드

Sets the message body
또한 보기: AcMailer\Service\MailServiceInterface::setBody()
public setBody ( Zend\Mime\Part | Zend\Mime\Message | string $body, string $charset = null )
$body Zend\Mime\Part | Zend\Mime\Message | string Email body
$charset string

setDefaultLayout() 공개 메소드

Sets the default layout to be used with all the templates set when calling setTemplate.
public setDefaultLayout ( AcMailer\View\DefaultLayoutInterface $layout = null ) : mixed
$layout AcMailer\View\DefaultLayoutInterface
리턴 mixed

setEventManager() 공개 메소드

Inject an EventManager instance
public setEventManager ( Zend\EventManager\EventManagerInterface $events )
$events Zend\EventManager\EventManagerInterface

setRenderer() 공개 메소드

public setRenderer ( Zend\View\Renderer\RendererInterface $renderer )
$renderer Zend\View\Renderer\RendererInterface

setSubject() 공개 메소드

Sets the message subject
사용 중단: Use $mailService->getMessage()->setSubject() instead
public setSubject ( string $subject )
$subject string The subject of the message

setTemplate() 공개 메소드

Sets the body of this message from a template
또한 보기: AcMailer\Service\MailServiceInterface::setTemplate()
public setTemplate ( string | Zend\View\Model\ViewModel $template, array $params = [] )
$template string | Zend\View\Model\ViewModel
$params array

setTransport() 공개 메소드

public setTransport ( Zend\Mail\Transport\TransportInterface $transport )
$transport Zend\Mail\Transport\TransportInterface