Jump to content

(SOLUCIONADO) Añadir asunto del mensaje a contact.html email


polu
 Share

Recommended Posts

Posted (edited)

Hola, llevo 3 horas intentando añadir el asunto del mensaje al archivo de los emails contact.html, no he conseguido nada, he intentado editar contactform.php pero sin resultados. He añadido una variable a la $var_list, pero no consigo conectar con la db para que me la reconozca.

La tabla con la que quiero conectar es: ps_contact_lang  y quiero que en el asunto me muestre el contenido del campo: name

He hecho lo siguiente:

He añadido {name} a la $var_list:

            $var_list = [
		'{name}' => '',
                '{firstname}' => '',
                '{lastname}' => '',
                '{order_name}' => '-',
                '{attached_file}' => '-',
                '{message}' => Tools::nl2br(Tools::htmlentitiesUTF8(Tools::stripslashes($message))),
                '{email}' => $from,
                '{product_name}' => '',
            ];

y luego he establecido una condición con el nombre y el campo de la tabla:

            if (isset($contact_lang ->id_contact)) {
                $var_list['{name}'] = $contact_lang->name;              
            }

¿alguien me puede orientar un poco?

Edited by polu
SOLUCIONADO (see edit history)

Share this post


Link to post
Share on other sites

  • polu changed the title to (SOLUCIONADO) Añadir asunto del mensaje a contact.html email

en contact.html, todo bien, me muestra el asunto y el mensaje pero en contact_form.html no me muestra el mensaje:

Asunto: Servicio al cliente

Mensaje: (hidden)

Share this post


Link to post
Share on other sites

Cambia esta parte

$var_list['{message}'] = self::MESSAGE_PLACEHOLDER_FOR_OLDER_VERSION;

por esto

$var_list['{message}'] = Tools::nl2br(Tools::htmlentitiesUTF8(Tools::stripslashes($message)));

 

  • Thanks 1

Share this post


Link to post
Share on other sites

Gracias una vez más Ventura, veo que has utilizado la función stripslashes(), si no me equivoco, para ayudar el envío por html. 

Saludos. 😉👋👋👋

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

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