PHP Class Themsaid\MailPreview\PreviewTransport

Inheritance: extends Illuminate\Mail\Transport\Transport
Show file Open project: themsaid/laravel-mail-preview Class Usage Examples

Protected Properties

Property Type Description
$files Illuminate\Filesystem\Filesystem The Filesystem instance.
$previewPath string Get the preview path.

Public Methods

Method Description
__construct ( Illuminate\Filesystem\Filesystem $files, string $previewPath, integer $lifeTime = 60 ) : void Create a new preview transport instance.
send ( Swift_Mime_Message $message, &$failedRecipients = null )

Protected Methods

Method Description
createEmailPreviewDirectory ( ) : void Create the preview directory if necessary.
getEMLPreviewContent ( Swift_Mime_Message $message ) : string Get the EML content for the preview file.
getHTMLPreviewContent ( Swift_Mime_Message $message ) : string Get the HTML content for the preview file.
getPreviewFilePath ( Swift_Mime_Message $message ) : string Get the path to the email preview file.

Private Methods

Method Description
cleanOldPreviews ( ) : void Delete previews older than the given life time configuration.
getMessageInfo ( Swift_Mime_Message $message ) : string Generate a human readable HTML comment with message info.

Method Details

__construct() public method

Create a new preview transport instance.
public __construct ( Illuminate\Filesystem\Filesystem $files, string $previewPath, integer $lifeTime = 60 ) : void
$files Illuminate\Filesystem\Filesystem
$previewPath string
$lifeTime integer
return void

createEmailPreviewDirectory() protected method

Create the preview directory if necessary.
protected createEmailPreviewDirectory ( ) : void
return void

getEMLPreviewContent() protected method

Get the EML content for the preview file.
protected getEMLPreviewContent ( Swift_Mime_Message $message ) : string
$message Swift_Mime_Message
return string

getHTMLPreviewContent() protected method

Get the HTML content for the preview file.
protected getHTMLPreviewContent ( Swift_Mime_Message $message ) : string
$message Swift_Mime_Message
return string

getPreviewFilePath() protected method

Get the path to the email preview file.
protected getPreviewFilePath ( Swift_Mime_Message $message ) : string
$message Swift_Mime_Message
return string

send() public method

public send ( Swift_Mime_Message $message, &$failedRecipients = null )
$message Swift_Mime_Message

Property Details

$files protected property

The Filesystem instance.
protected Filesystem,Illuminate\Filesystem $files
return Illuminate\Filesystem\Filesystem

$previewPath protected property

Get the preview path.
protected string $previewPath
return string