Zendで送信したいメールの本文変数を作成しようとしています。パーシャルをロードしてモデルに渡し、モデルにパッケージ化して送信することができます。私が抱えている問題は、投稿情報を使用して電子メールを入力するために、$buyerをパーシャルに渡したいということです。
$buyerには私の投稿データがすべて含まれています。そのため、その変数の横に名前、住所、電話番号、およびその他の情報があります。$ body2は、電子メールで送信する前に$buyerからの情報を入力できるようにする単純なHTMLスクリプトです。
// Get the Post Data
$buyer = $request->getPost();
// Creates the body for the email with the users information
$body2 = $this->view->partial('partials/enterpriseContact.phtml');
やってみた-
$body2 = $this->view->partial('partials/enterpriseContact.phtml', $buyer);
しかし、それはうまくいきませんでした。それが違いを生むなら、私はコントローラーの内部で働いています。したがって、完全なコードブロックは次のようになります-
// Get the Post Data
$buyer = $request->getPost();
// Create the body variable by loading the partial for the post card.
$body = $this->view->partial('partials/postcardEmail/eform1stpostcard.htm');
// Creates the body for the business email with the users information
$body2 = $this->view->partial('partials/enterpriseContact.phtml');
// New Model For Mail Client
$mailUs = new Model_MailUs(); // Instantiate the model to handle Emails
// Use that model to send the email, requires variables, who to send to, and body
$mailUs->sendMail($request->getPost(), 'guest', $body); // Sends an email to the user
$mailUs->sendMail($request->getPost(), 'link', $body2); // Sends an email to us
Zendのコントローラーからパーシャル内に変数を入れるにはどうすればよいですか?