mirror of
https://github.com/retailcrm/mailgun-php.git
synced 2025-02-11 18:59:22 +03:00
Don't require @ prefix for attachment filenames
This commit is contained in:
parent
7f2fa66030
commit
a674addd2a
@ -169,26 +169,22 @@ class MessageBuilder
|
|||||||
|
|
||||||
public function addAttachment($attachmentPath, $attachmentName = null)
|
public function addAttachment($attachmentPath, $attachmentName = null)
|
||||||
{
|
{
|
||||||
if (preg_match("/^@/", $attachmentPath)) {
|
if (isset($this->files["attachment"])) {
|
||||||
if (isset($this->files["attachment"])) {
|
$attachment = array(
|
||||||
$attachment = array(
|
'filePath' => $attachmentPath,
|
||||||
|
'remoteName' => $attachmentName
|
||||||
|
);
|
||||||
|
array_push($this->files["attachment"], $attachment);
|
||||||
|
} else {
|
||||||
|
$this->files["attachment"] = array(
|
||||||
|
array(
|
||||||
'filePath' => $attachmentPath,
|
'filePath' => $attachmentPath,
|
||||||
'remoteName' => $attachmentName
|
'remoteName' => $attachmentName
|
||||||
);
|
)
|
||||||
array_push($this->files["attachment"], $attachment);
|
);
|
||||||
} else {
|
|
||||||
$this->files["attachment"] = array(
|
|
||||||
array(
|
|
||||||
'filePath' => $attachmentPath,
|
|
||||||
'remoteName' => $attachmentName
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
throw new InvalidParameter(INVALID_PARAMETER_ATTACHMENT);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function addInlineImage($inlineImagePath, $inlineImageName = null)
|
public function addInlineImage($inlineImagePath, $inlineImageName = null)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user