I downloaded the script to send the form data to an email (name, email, phone, etc.). I want the letter to include a specific div with all the content inside it.

Now it looks like this:

$form['form-1'] = array( 'fields' => array( 'name' => array( 'title' => 'Имя: ') 'email' => array( 'title' => 'Эмейл клиента: ') 

etc. HTML

  <form action="" method="get" name="form-1"> <input name="name" type="text" placeholder="Ваше имя"> </form> 

Then he using

  $sb['body'] = ""; // парсим шаблон if($form['cfg']['tpl']) { $out = tpl(array('name' => $act, 'getdata' => $getdata, 'cfg' => $form['cfg'])); if(is_string($out)) { $sb['body'] = $out; } } $mail = mail($To, $sb['subject'], $sb['body'], $headers); 

poisons the given forms on an email (such as).

The template looks like this:

 <table border="0" style="color:#333; padding: 20px;"> <tr> <td>%%name.title%%</td> <td>%%name.value%%</td> </tr> </table> 

It is necessary that the letter include the results of a certain calculation, which in the final htmle looks like this:

 <div id="need"> <div id="length"> <span>Длина : ></span><span class="received_data_from_js">95</span> <span>Стоимость: ></span><span class="received_data1_from_js">190</span> </div> 

How to do this?

    1 answer 1

    Add your html to the template

     <table border="0" style="color:#333; padding: 20px;"> <tr> <td>%%name.title%%</td> <td>%%name.value%%</td> </tr> </table> <div id="length"> <span>Длина : ></span><span class="received_data_from_js">%%length%%</span> <span>Стоимость: ></span><span class="received_data1_from_js">%%cost%%</span> </div> 

    and then pass the length and cost parameters to it

     $sb['body'] = ""; // парсим шаблон if($form['cfg']['tpl']) { $out = tpl(['name' => $act, 'getdata' => $getdata, 'cfg' => $form['cfg'], 'length' => 'ЗНАЧЕНИЕ ДЛИНЫ', 'cost' => 'ЗНАЧЕНИЕ СТОИМОСТИ']); if(is_string($out)) { $sb['body'] = $out; } } $mail = mail($To, $sb['subject'], $sb['body'], $headers);