Class AttachmentsHandler

Class AttachmentsHandler

This class will handle the email attachments organization. Every email must have its own attachments directory so that we can avoid file issues between emails.

AttachmentsHandler implements AttachmentsHandlerInterface
Package: Email
Category: System
Located at Services/System/Email/AttachmentsHandler.inc.php

Methods summary

public __construct( string $p_uploadsDirPath )

Class Constructor

public uploadAttachment( EmailAttachmentInterface $attachment ) : EmailAttachment

Upload an attachment to "uploads/tmp" directory.

public deleteAttachment( EmailAttachmentInterface $attachment )

Removes a single email attachment.

public uploadEmailCollection( EmailCollectionInterface $collection )

Process attachments for each email in collection.

public deleteEmailCollection( EmailCollectionInterface $collection )

Delete attachments for each email in collection.

public getAttachmentsSize( void ) : integer

Get attachments directory file size in bytes.

public deleteOldAttachments( DateTime $removalDate ) : array

Delete old attachments prior to removal date.

public backupEmailAttachments( EmailInterface & $email )

Process email attachments.

public deleteEmailAttachments( EmailInterface $email )

Deletes email attachments.

public emptyTempDirectory( void )

Removes all files within the "uploads/tmp" directory.

Properties summary

protected $uploadsDirPath : string

Full server path to "uploads" directory.