public function addAttachments($attachments)
{
if (!empty($attachments)) {
// add attachments one by one
foreach ($attachments as $attachment) {
// only add existing files
if (is_file($attachment)) {
$this->attach(\Swift_Attachment::fromPath($attachment));
}
}
}
return $this;
}