Modifications

This commit is contained in:
2020-06-09 10:50:42 +02:00
parent 4a3ecb3a61
commit 169e532434
2 changed files with 21 additions and 17 deletions

View File

@@ -153,6 +153,16 @@ class BluescaleMailTemplate implements \JsonSerializable
return $this;
}
public function addAttachment($file, $filename = null)
{
$file = is_object($file) && method_exists($file, 'getRealPath') ? $file->getRealPath() : $file;
$this->attachments[] = [
'file' => $file,
'filename' => $filename ?? basename($file)
];
}
/**
* @param string $key
* @param string $value