protected prepareAttachment ( Swift_Mime_Attachment $attachment, string $name = null, string $mime = null ) : self | ||
$attachment | Swift_Mime_Attachment | |
$name | string | |
$mime | string | |
return | self |
protected function prepareAttachment(Swift_Mime_Attachment $attachment, $name = null, $mime = null)
{
if (null !== $mime) {
$attachment->setContentType($mime);
}
if (null !== $name) {
$attachment->setFilename($name);
}
$this->attach($attachment);
return $this;
}