EmailAttachment

Implements \EmailAttachmentInterface

Class EmailAttachment

Email attachment will serve as the path to the file that needs to be attached (located on the server).

category

System

package

Email

subpackage

Entities

Methods

Constructor

__construct(\AttachmentPathInterface $path = null, \AttachmentNameInterface $name = null) 

Entity representing an email attachment.

Arguments

$path

\AttachmentPathInterface

(optional) Attachment path.

$name

\AttachmentNameInterface

(optional) Attachment name.

Convert a path to relative.

_convertToRelativePath(\AttachmentPathInterface $path = null) : string

Due to different server setups this process can be tedious and hard to foresee. The following method contains the conversion logic and must be used in any setter of the class.

Arguments

$path

\AttachmentPathInterface

Attachment path.

Response

string

Returns the converted path.

Returns the name of an email attachment.

getName() : \AttachmentNameInterface

Response

\AttachmentNameInterface

Attachment name.

Returns the path of an email attachment.

getPath(boolean $absolutePath = true) : \AttachmentPathInterface

Arguments

$absolutePath

boolean

(optional) Whether to return the absolute path or the relative one.

Response

\AttachmentPathInterface

Attachment path.

Sets the name of an email attachment.

setName(\AttachmentNameInterface $name) 

Arguments

$name

\AttachmentNameInterface

Attachment name.

Sets the path of an email attachment.

setPath(\AttachmentPathInterface $path) 

Arguments

$path

\AttachmentPathInterface

Attachment path.

Properties

E-Mail attachment path.

path : string
var

Type(s)

string

E-Mail attachment name.

name : string
var

Type(s)

string