0

I just wanted to know if there is a way to send a mail from twig. I have my templeate, there is 2 text boxes, one for the destination, and other one for the message. can anyone help me with it?

Or if there is a way that using JS, PHP or something like that with twig to do that?

Any kind help is welcome haha thanks

Erick Rosas
  • 141
  • 3
  • 14

1 Answers1

1

If you are using Bolt (assumption based on the tag), then my suggestion would be to install the BoltForms (bolt/boltforms) extension.

Out of the box, it has a "default" example contact form (that you can safely remove from it's configuration, or modify to your needs) that you can ad to a template with:

{{ boltforms('contact') }}

The contact string tells BoltForms which named form from your configuration you want to use.

Also note, that Bolt uses Swiftmailer to handle emails, and it makes a best guess to configure itself by default, but you really should set the mailoptions parameters in your main Bolt configuration file

Gawain
  • 1,568
  • 10
  • 8