diff --git a/CHANGELOG.md b/CHANGELOG.md index b47ce53..78971ef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +# v4.0.4 +## 07/10/2023 + +1. [](#bugfix) + * Fix for email file attachments using stream + # v4.0.3 ## 06/29/2023 diff --git a/blueprints.yaml b/blueprints.yaml index 442a62c..d3a66a0 100644 --- a/blueprints.yaml +++ b/blueprints.yaml @@ -1,7 +1,7 @@ name: Email slug: email type: plugin -version: 4.0.3 +version: 4.0.4 testing: false description: Enables the emailing system for Grav icon: envelope diff --git a/email.php b/email.php index b96ff36..da59047 100644 --- a/email.php +++ b/email.php @@ -125,6 +125,7 @@ protected function sendFormEmail($form, $params, $vars) { // Build message $message = $this->email->buildMessage($params, $vars); + $locator = $this->grav['locator']; if (isset($params['attachments'])) { $filesToAttach = (array)$params['attachments']; @@ -135,9 +136,11 @@ protected function sendFormEmail($form, $params, $vars) if (isset($fileValues['file'])) { $filename = $fileValues['file']; } else { - $filename = ROOT_DIR . $fileValues['path']; + $filename = $fileValues['path']; } + $filename = $locator->findResource($filename, true, true); + try { $message->attachFromPath($filename); } catch (\Exception $e) { diff --git a/languages.yaml b/languages.yaml index 4cb044c..9f1fc7f 100644 --- a/languages.yaml +++ b/languages.yaml @@ -78,6 +78,7 @@ fr: PLUGIN_EMAIL: MAIL_ENGINE: "Moteur de messagerie" MAIL_ENGINE_DISABLED: "Désactivé" + MAIL_ENGINE_DESC: "NOTE : Si vous sélectionnez un moteur fourni par un autre plugin, vous devez configurer les options dans ce même plugin." CONTENT_TYPE: "Type de contenu" CONTENT_TYPE_PLAIN_TEXT: "Texte brut" CHARSET: "Jeu de caractères" @@ -130,7 +131,9 @@ fr: QUEUE_FLUSH_MSG_LIMIT: "Messages par Flush" QUEUE_FLUSH_MSG_LIMIT_APPEND: "Messages" QUEUE_FLUSH_TIME_LIMIT: "Délai de Flush" - QUEUE_FLUSH_TIME_LIMIT_APPEND: "Seconds" + QUEUE_FLUSH_TIME_LIMIT_APPEND: "Secondes" + EMAIL_FORMAT: "Utilisez le format `addr` : `email@adresse.org` ou le format `name-addr` : `Votre nom `. Séparer par des virgules pour plusieurs adresses." + hr: PLUGIN_EMAIL: