mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
MINOR Allowing parameter in Email::attachFile() to be optional (fixes #6506, thanks adrianduke)
This commit is contained in:
parent
88535a43c5
commit
7cb35435f1
@ -169,6 +169,7 @@ class Email extends ViewableData {
|
||||
}
|
||||
|
||||
public function attachFile($filename, $attachedFilename = null, $mimetype = null) {
|
||||
if(!$attachedFilename) $attachedFilename = basename($filename);
|
||||
$absoluteFileName = Director::getAbsFile($filename);
|
||||
if(file_exists($absoluteFileName)) {
|
||||
$this->attachFileFromString(file_get_contents($absoluteFileName), $attachedFilename, $mimetype);
|
||||
|
Loading…
x
Reference in New Issue
Block a user