alengo / alengo-form-bundle
Form Bundle
Installs: 1 838
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 3
Forks: 0
Open Issues: 0
Type:sulu-bundle
pkg:composer/alengo/alengo-form-bundle
Requires
- php: ^8.2
- sulu/sulu: ^3.0
- symfony/config: ^7.2
- symfony/dependency-injection: ^7.2
- symfony/framework-bundle: ^7.2
- symfony/http-foundation: ^7.2
- symfony/http-kernel: ^7.2
- symfony/mailer: ^7.2
- symfony/serializer: ^7.2
- symfony/twig-bundle: ^7.2
Requires (Dev)
- jackalope/jackalope-doctrine-dbal: ^1.10 || ^2.0
- php-cs-fixer/shim: ^3.93
- rector/rector: ^2.3
- symfony/browser-kit: ^7.2
- symfony/console: ^7.2
This package is auto-updated.
Last update: 2026-02-02 18:02:00 UTC
README
Requirements
- Sulu 3.x
- PHP 8.2
- Symfony >=7.2
- Symfonymailer >=7.2
Install the bundle
Execute the following composer command
composer require alengo/alengo-form-bundle
Enable the bundle
Enable the bundle by adding it to the list of registered bundles in the config/bundles.php file of your project:
return [ /* ... */ Alengo\Bundle\AlengoFormBundle\AlengoFormBundle::class => ['all' => true], ];
bin/console do:sch:up --force
Configure the Bundle
Set the following config in your routes_admin.yaml
AlengoFormBundle: resource: "@AlengoFormBundle/config/routing_admin.yaml" prefix: /admin/api
Define you default Sender Email in ENV Config.
DEFAULT_SENDER_MAIL=test@test.de
DEFAULT_SENDER_NAME=Mustermann
Use the Bundle
You can use and include the following two interfaces to save the forms and send an email with them
Alengo\Bundle\AlengoFormBundle\Service\SaveFormInterface
public function saveFormDataFromRequest(array $data, string $webspace, string $location, string $category, string $receiverMail = NULL, bool $copy = false): FormData;
Alengo\Bundle\AlengoFormBundle\Service\SendFormInterface
public function sendFormDataAsMail(FormData $formData, string $template, string $title, string $receiverMail,string $senderMail,$xmlTemplate = false);
Example
Simple example which sends a copy to the person who filled in the form and his deposited mail
$formData = $this->saveForm->saveFormDataFromRequest($request->request->all(),$request->get('_sulu')->getAttribute('webspace')->getKey(),$request->getLocale(),'contact',NULL,true); $this->sendForm->sendFormDataAsMail($formData,'hello/email.txt.twig','Welcome Mail','receiver@mail.de');