Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sherlockode/user-confirmation-bundle
Symfony Bundle for the confirmation process of a user registration
https://github.com/sherlockode/user-confirmation-bundle
Last synced: about 4 hours ago
JSON representation
Symfony Bundle for the confirmation process of a user registration
- Host: GitHub
- URL: https://github.com/sherlockode/user-confirmation-bundle
- Owner: sherlockode
- License: mit
- Created: 2017-12-04T10:55:25.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2022-08-31T15:50:47.000Z (about 2 years ago)
- Last Synced: 2024-10-27T21:14:27.288Z (19 days ago)
- Language: PHP
- Homepage:
- Size: 54.7 KB
- Stars: 1
- Watchers: 6
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
SherlockodeUserConfirmationBundle
=================================The SherlockodeUserConfirmationBundle provides a way to create a user account that will stay disabled until the
user visits a confirmation link sent by email and sets a password.## Prerequisites
This version of the bundle requires Symfony 3.* or 4.* and FOSUserBundle
## Installation
### Step 1: Install SherlockodeUserConfirmationBundle
Install with [Composer](https://getcomposer.org/):
```bash
$ composer require sherlockode/user-confirmation-bundle
```Enable the bundle in the Symfony kernel:
```php
['all' => true],
];
```### Step 2: Configure the bundle
Import the routing in `config/routes.yaml`
```yaml
sherlockode_user_confirmation:
resource: "@SherlockodeUserConfirmationBundle/Resources/config/routing.xml"
```Then create the configuration in `config/packages/sherlockode_user_confirmation.yaml`
```yaml
sherlockode_user_confirmation:
from_email: [email protected] # From email address
from_name: John Doe # Name of the expeditor
email_subject: Please confirm your account # The subject for the confirmation email (optional)
redirect_after_confirmation: admin_dashboard # The route name to redirect the user after confirmation
```## Customization
### Extend the confirmation form template
To extend the confirmation form template, just update your `sherlockode_user_confirmation.yaml`
```yaml
sherlockode_user_confirmation:
templates:
confirmation_form: 'Registration/confirmation.html.twig'
```Then in your template, add a placeholder for the block `sherlockode_user_confirmation_form`
```twig
My awesome app !
{# The form will be render here #}
{% block sherlockode_user_confirmation_form %}{% endblock %}
```
### Extend the confirmation email
If you want to extend the confirmation email template, you should add the path in your `config.yml`
```yaml
sherlockode_user_confirmation:
templates:
confirmation_email: 'Email/registration.html.twig'
```In this template, you have access to the `user` object, and to a variable named `confirmationUrl` which contains the url to access the confirmation form.
### Send confirmation email
If you want to send the confirmation again for an existing user, use the following link :
```twig
Send confirmation email
```