Skip to content
Snippets Groups Projects
Commit 7a4c820e authored by Alex Arnaud's avatar Alex Arnaud
Browse files

dev#25584 - Fix mail body sent from articles/forms

parent 5ea67881
Branches
Tags
4 merge requests!1132Hotline#29412 images des articles dans le resultat de recherche,!1120Master,!1103Dev#25584 ajout de formulaires qui s envoient par mail,!1089Dev#25584 ajout de formulaires qui s envoient par mail
......@@ -32,7 +32,7 @@ class FormulaireController extends ZendAfi_Controller_Action {
$this->view->article = $article;
if ($address = $article->getDestinationEmail()) {
$this->_sendFormEmail($address, $this->view->datas);
$this->_sendFormEmail($address, $formulaire->dataAsBodyText());
$this->view->email_sent = true;
}
}
......
......@@ -111,6 +111,15 @@ class Class_Formulaire extends Storm_Model_Abstract {
}
public function dataAsBodyText() {
$body = '';
foreach ($this->getDatas() as $name => $value)
$body .= "$name: $value\n";
return $body;
}
public function _get($attribute) {
try {
return parent::_get($attribute);
......
......@@ -74,7 +74,7 @@ class FormulaireControllerWithEmailPostActionTest extends FormulaireControllerPo
/** @test */
public function mailContentShouldContainData() {
$this->assertContains('Tinguette', quoted_printable_decode($this->mock_transport->getSentMails()[0]->getBodyText()->getContent()['nom']));
$this->assertContains('nom: Tinguette', quoted_printable_decode($this->mock_transport->getSentMails()[0]->getBodyText()->getContent()));
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment