Jump to content
Silviotrisorio

Errore invio email da modulo contatti

Recommended Posts

Ciao,

ho lo stesso problema su tre siti diversi 1.7, all'invio dal modulo contatti ricevo "Si è verificato un errore durante l'invio del messaggio, si prega di riprovare."

provato sia SMTP Che Php Mail, in tutti e tre le mail di test dalla pagina della configurazione SMTP del BO partono corretamente ma dal modulo contatti no.

 

Sono tre installazioni diverse... com'è possibile?

 

Grazie in anticipo.

Share this post


Link to post
Share on other sites

Ciao,

ummm...se mi ricordo bene era un "vecchio" problema di ps 1.7.....é sul template contactform.tpl del modulo contactform

 

con inspezina vedi se compare questo codice:

 

<input type="hidden" name="url" value=""/>
      <input type="hidden" name="token" value="{$token}">

 

 

se non compare aggiungilo al template del form

 

devi avere una "roba" tipo questa:-)..

 

<input type="text" name="url" value=""/>

<input type="hidden" name="token" value="{$token}" />

<button type="submit" name="submitMessage"> {l s='Send' d='Modules.Contactform.Shop'}

 

ciao

 

Share this post


Link to post
Share on other sites

Ciao Fabry,

non compare e anche aggiungendolo non cambia. Allego il codice:

<section class="contact-form">
  <form action="{$urls.pages.contact}" method="post" {if $contact.allow_file_upload}enctype="multipart/form-data"{/if}>

    {if $notifications}
      <div class="col-xs-12 alert {if $notifications.nw_error}alert-danger{else}alert-success{/if}">
        <ul>
          {foreach $notifications.messages as $notif}
            <li>{$notif}</li>
          {/foreach}
        </ul>
      </div>
    {/if}

    {if !$notifications || $notifications.nw_error}
      <section class="form-fields">

        <div class="form-group row">
          <div class="col-md-9 col-md-offset-3">
            <h3>{l s='Contact us' d='Shop.Theme.Global'}</h3>
          </div>
        </div>

        <div class="form-group row">
          <label class="col-md-3 form-control-label">{l s='Subject' d='Shop.Forms.Labels'}</label>
          <div class="col-md-6">
            <select name="id_contact" class="form-control form-control-select">
              {foreach from=$contact.contacts item=contact_elt}
                <option value="{$contact_elt.id_contact}">{$contact_elt.name}</option>
              {/foreach}
            </select>
          </div>
        </div>

        <div class="form-group row">
          <label class="col-md-3 form-control-label">{l s='Email address' d='Shop.Forms.Labels'}</label>
          <div class="col-md-6">
            <input
              class="form-control"
              name="from"
              type="email"
              value="{$contact.email}"
              placeholder="{l s='your@email.com' d='Shop.Forms.Help'}"
            >
          </div>
        </div>

        {if $contact.orders}
          <div class="form-group row">
            <label class="col-md-3 form-control-label">{l s='Order reference' d='Shop.Forms.Labels'}</label>
            <div class="col-md-6">
              <select name="id_order" class="form-control form-control-select">
                <option value="">{l s='Select reference' d='Shop.Forms.Help'}</option>
                {foreach from=$contact.orders item=order}
                  <option value="{$order.id_order}">{$order.reference}</option>
                {/foreach}
              </select>
            </div>
            <span class="col-md-3 form-control-comment">
              {l s='optional' d='Shop.Forms.Help'}
            </span>
          </div>
        {/if}

        {if $contact.allow_file_upload}
          <div class="form-group row">
            <label class="col-md-3 form-control-label">{l s='Attachment' d='Shop.Forms.Labels'}</label>
            <div class="col-md-6">
              <input type="file" name="fileUpload" class="filestyle" data-buttonText="{l s='Choose file' d='Shop.Theme.Actions'}">
            </div>
            <span class="col-md-3 form-control-comment">
              {l s='optional' d='Shop.Forms.Help'}
            </span>
          </div>
        {/if}

        <div class="form-group row">
          <label class="col-md-3 form-control-label">{l s='Message' d='Shop.Forms.Labels'}</label>
          <div class="col-md-9">

            <textarea
              class="form-control"
              name="message"
              placeholder="{l s='How can we help?' d='Shop.Forms.Help'}"
              rows="3"
            >{if $contact.message}{$contact.message}{/if}</textarea>
          </div>
        </div>

      </section>


      <footer class="form-footer text-sm-right">

        <input class="btn btn-primary" type="submit" name="submitMessage" value="{l s='Send' d='Shop.Theme.Actions'}">
      </footer>
    {/if}

  </form>
</section>

 

Share this post


Link to post
Share on other sites

...scommetto che non hai aggiornato  il contactform.tpl del tema:-9...é quello che fá override del file tpl del modulo principale...per cui cambia anche il corrispettivo file nella cartella del modulo del tema.

 

nel codice che mi hai scritto....non hai aggiunto le due righe che ti ho indicato!...ultima parte del file

 

deve avere questo codice:

 

<footer class="form-footer text-sm-right">

<input type="text" name="url" value=""/>

<input type="hidden" name="token" value="{$token}" />

<input class="btn btn-primary" type="submit" name="submitMessage" value="{l s='Send' d='Shop.Theme.Actions'}">

</footer>

{/if}

 

 

 

 

fammi sapere

Share this post


Link to post
Share on other sites

L'avevo fatto, ti ho solo postato il codice pulito nel caso avessi sbagliato.

 

A questo link https://www.huskymoto-monza.com/index.php?controller=contact  c'è il modulo contatti con il contactform.tpl modificato come da tue indicazioni.

Se hai voglia provalo:

 

Ecco il codice così come l'ho modificato:

 

{**
 * 2007-2017 PrestaShop
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Academic Free License 3.0 (AFL-3.0)
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * https://opensource.org/licenses/AFL-3.0
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@prestashop.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade PrestaShop to newer
 * versions in the future. If you wish to customize PrestaShop for your
 * needs please refer to http://www.prestashop.com for more information.
 *
 * @author    PrestaShop SA <contact@prestashop.com>
 * @copyright 2007-2017 PrestaShop SA
 * @license   https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
 * International Registered Trademark & Property of PrestaShop SA
 *}
<section class="contact-form">
  <form action="{$urls.pages.contact}" method="post" {if $contact.allow_file_upload}enctype="multipart/form-data"{/if}>

    {if $notifications}
      <div class="col-xs-12 alert {if $notifications.nw_error}alert-danger{else}alert-success{/if}">
        <ul>
          {foreach $notifications.messages as $notif}
            <li>{$notif}</li>
          {/foreach}
        </ul>
      </div>
    {/if}

    {if !$notifications || $notifications.nw_error}
      <section class="form-fields">

        <div class="form-group row">
          <div class="col-md-9 col-md-offset-3">
            <h3>{l s='Contact us' d='Shop.Theme.Global'}</h3>
          </div>
        </div>

        <div class="form-group row">
          <label class="col-md-3 form-control-label">{l s='Subject' d='Shop.Forms.Labels'}</label>
          <div class="col-md-6">
            <select name="id_contact" class="form-control form-control-select">
              {foreach from=$contact.contacts item=contact_elt}
                <option value="{$contact_elt.id_contact}">{$contact_elt.name}</option>
              {/foreach}
            </select>
          </div>
        </div>

        <div class="form-group row">
          <label class="col-md-3 form-control-label">{l s='Email address' d='Shop.Forms.Labels'}</label>
          <div class="col-md-6">
            <input
              class="form-control"
              name="from"
              type="email"
              value="{$contact.email}"
              placeholder="{l s='your@email.com' d='Shop.Forms.Help'}"
            >
          </div>
        </div>

        {if $contact.orders}
          <div class="form-group row">
            <label class="col-md-3 form-control-label">{l s='Order reference' d='Shop.Forms.Labels'}</label>
            <div class="col-md-6">
              <select name="id_order" class="form-control form-control-select">
                <option value="">{l s='Select reference' d='Shop.Forms.Help'}</option>
                {foreach from=$contact.orders item=order}
                  <option value="{$order.id_order}">{$order.reference}</option>
                {/foreach}
              </select>
            </div>
            <span class="col-md-3 form-control-comment">
              {l s='optional' d='Shop.Forms.Help'}
            </span>
          </div>
        {/if}

        {if $contact.allow_file_upload}
          <div class="form-group row">
            <label class="col-md-3 form-control-label">{l s='Attachment' d='Shop.Forms.Labels'}</label>
            <div class="col-md-6">
              <input type="file" name="fileUpload" class="filestyle" data-buttonText="{l s='Choose file' d='Shop.Theme.Actions'}">
            </div>
            <span class="col-md-3 form-control-comment">
              {l s='optional' d='Shop.Forms.Help'}
            </span>
          </div>
        {/if}

        <div class="form-group row">
          <label class="col-md-3 form-control-label">{l s='Message' d='Shop.Forms.Labels'}</label>
          <div class="col-md-9">
            <textarea
              class="form-control"
              name="message"
              placeholder="{l s='How can we help?' d='Shop.Forms.Help'}"
              rows="3"
            >{if $contact.message}{$contact.message}{/if}</textarea>
          </div>
        </div>

      </section>

      <footer class="form-footer text-sm-right">
 <input type="text" name="url" value=""/>

<input type="hidden" name="token" value="{$token}" /> 
        <input class="btn btn-primary" type="submit" name="submitMessage" value="{l s='Send' d='Shop.Theme.Actions'}">
      </footer>
    {/if}

  </form>
</section>

 

Share this post


Link to post
Share on other sites
Posted (edited)

Silvio il codice non lo hai inserito....attenzione che devi andare nella cartella del modulo contact nel template.

 

/themes/NOMEDELTUOTEMA/modules/contactform/views/templates/widget/contactform.tpl

allego immagine, come vedi non c'é.

 

Ps: pulisci cache e rigenera il template!

 

 

contactform.png

Edited by Fabry (see edit history)

Share this post


Link to post
Share on other sites

Ciuo Fabry,

il codice lho aggiunto, allego Screnshot con il percorso, ma vedo che nel tuo screenshot il codice è diverso... e se il tema stesse usando il modulo di prestashop?

 

Schermata 2019-10-05 alle 20.53.51.png

Share this post


Link to post
Share on other sites

Ok si certo, manca una parte...

 

  <footer class="form-footer text-sm-right">
        <style>
          input[name=url] {
            display: none !important;
          }

        </style>
        <input type="text" name="url" value=""/>
        <input type="hidden" name="token" value="{$token}" />
        <input class="btn btn-primary" type="submit" name="submitMessage" value="{l s='Send' d='Shop.Theme.Actions'}">
      </footer>
    {/if}

 

 

 

Share this post


Link to post
Share on other sites

Ok grazie,

ora il modulo non va in errore ma le email non partono lo stesso... i test di invio nel BO funzionano correttamente, le email partono...ma da l modulo no...da cosa può dipendere?

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More