How to configure the email template for each form?

Olá, pessoal! Sou novo por aqui e gostaria de pedir ajuda com uma dúvida sobre layout de e-mail.

Recentemente testei os formulários disponíveis e achei o recurso muito interessante. Criei um formulário de contato e, ao testar, surgiu a seguinte pergunta:

  • Se tivermos diversos formulários, é possível atribuir um template de e-mail diferente para cada um deles?
  • Em caso afirmativo, como posso configurar isso no Cockpit V2?

Agradeço desde já pela atenção e espero estar no lugar certo para essa pergunta. :blush:


Ingles

Hello everyone! I’m new here and would like some help with an email layout question.

I recently tried out the available forms and found the feature really cool. I created a contact form and during testing, I wondered:

  1. If we have multiple forms, is it possible to assign a different email template to each one?
  2. If so, how can I configure this in Cockpit V2?

Thanks in advance for your help—I hope this is the right place for my question.

Hi!

Create the following file config/inbox/layouts/email.php. In that file you can load different layouts based on the passed $form variable.

Greets,
Artur

Hi @artur, thank you very much.
It worked perfectly.

I created the inbox/layouts/email.php folder within the config. Within these files, I was able to identify the form name using $form[‘name’]. This allows me to determine which code structure I want to load!