https://github.com/fmikl/newsletterbundle
A Symfony application bundle for managing newsletters, giving users the ability to subscribe or unsubscribe, and allowing the administrator to send out newsletters.
https://github.com/fmikl/newsletterbundle
symfony-bundle symfony6
Last synced: 3 months ago
JSON representation
A Symfony application bundle for managing newsletters, giving users the ability to subscribe or unsubscribe, and allowing the administrator to send out newsletters.
- Host: GitHub
- URL: https://github.com/fmikl/newsletterbundle
- Owner: FmiKL
- License: mit
- Created: 2023-12-27T08:27:34.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-12-27T09:03:43.000Z (over 1 year ago)
- Last Synced: 2025-01-23T02:13:56.824Z (5 months ago)
- Topics: symfony-bundle, symfony6
- Language: PHP
- Homepage:
- Size: 13.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# NewsletterBundle
## About
This project is an **application bundle** for Symfony, designed to be intrinsically integrated into an existing application. It revolves around a newsletter management system, enabling the efficient dispatch of information and announcements to subscribed users.
## Configuration
### Installation
Clone the repository into your Symfony project:
```shell
git clone https://github.com/mikael-fourre/NewsletterBundle
```Ensure the bundle is registered in your `config/bundles.php` file:
```php
return [
// ...
App\Bundle\NewsletterBundle\NewsletterBundle::class => ['all' => true],
];
```### Routing Configuration
Add the bundle's routes to your routing configuration.
```yaml
# config/routes.yamlnewsletter_bundle:
resource: '@NewsletterBundle/config/routes.yaml'
```The routes provided by the bundle are:
- `newsletter_subscribe`: Handles newsletter subscriptions
- `newsletter_confirm`: Manages subscription confirmations
- `newsletter_unsubscribe`: Manages unsubscriptions
- `newsletter_send`: Sends newsletters to all subscribed users (admin access only)### Template Configuration
Configure the template paths by adjusting your `twig.yaml` file to recognize the NewsletterBundle's templates.
```yaml
# config/packages/twig.yamltwig:
paths:
'%kernel.project_dir%/src/Bundle/NewsletterBundle/templates': NewsletterBundle
```### Parameters Configuration
Define custom parameters in your services.yaml file to configure the contact email address.
```yaml
# config/services.yamlparameters:
contact_email: [email protected]
```### Security Configuration
Secure the administration route by adjusting your `security.yaml` file.
```yaml
# config/packages/security.yamlsecurity:
access_control:
- { path: ^/admin, roles: ROLE_ADMIN }
```## Usage
- **Subscription**: Send a POST request to `/newsletter/subscribe`
- **Confirmation**: Redirect users to `/newsletter/confirm`
- **Unsubscription**: Use `/newsletter/unsubscribe` for unsubscriptions
- **Newsletter Sending** (admin only): A POST request to `/admin/newsletter/send` sends newsletters## Contributing
Contributions are always welcome! To contribute:
- Fork the project
- Create a branch for your modifications
- Submit a Pull Request## Support
Should you encounter issues or have questions, feel free to open an issue on GitHub.
## License
This project is licensed under the terms of the [MIT License](LICENSE). For more information, please refer to the file.