2017 © Pedro Peláez
 

symfony-bundle user-confirmation-bundle

Symfony Bundle for the confirmation process of a user registration

image

sherlockode/user-confirmation-bundle

Symfony Bundle for the confirmation process of a user registration

  • Tuesday, July 31, 2018
  • by sherlockode
  • Repository
  • 4 Watchers
  • 0 Stars
  • 54 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 8 Versions
  • 64 % Grown

The README.md

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., (*1)

Prerequisites

This version of the bundle requires Symfony 3.* or 4.* and FOSUserBundle, (*2)

Installation

Step 1: Install SherlockodeUserConfirmationBundle

Install with Composer:, (*3)

$ composer require sherlockode/user-confirmation-bundle

Enable the bundle in the Symfony kernel:, (*4)

<?php
// config/bundles.php
return [
    // ...
    Sherlockode\UserConfirmationBundle\SherlockodeUserConfirmationBundle::class => ['all' => true],
];

Step 2: Configure the bundle

Import the routing in config/routes.yaml, (*5)

sherlockode_user_confirmation:
    resource: "@SherlockodeUserConfirmationBundle/Resources/config/routing.xml"

Then create the configuration in config/packages/sherlockode_user_confirmation.yaml, (*6)

sherlockode_user_confirmation:
    from_email: no-reply@awesome.com                # 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, (*7)

sherlockode_user_confirmation:
    templates:
        confirmation_form: 'Registration/confirmation.html.twig'

Then in your template, add a placeholder for the block sherlockode_user_confirmation_form, (*8)

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8" />
</head>
<body>
    <h1>My awesome app !</h1>
    <div>
        {# The form will be render here #}
        {% block sherlockode_user_confirmation_form %}{% endblock %}
    </div>
</body>
</html>

Extend the confirmation email

If you want to extend the confirmation email template, you should add the path in your config.yml, (*9)

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., (*10)

Send confirmation email

If you want to send the confirmation again for an existing user, use the following link :, (*11)

<a href="{{ path('sherlockode_user_confirmation_send_confirmation', {id: userId}) }}">
    Send confirmation email
</a>

The Versions

31/07 2018

dev-master

9999999-dev https://github.com/sherlockode/user-confirmation-bundle

Symfony Bundle for the confirmation process of a user registration

  Sources   Download

MIT

The Requires

 

by Avatar sherlockode
by Neil Peyssard

31/07 2018

v0.2.2

0.2.2.0 https://github.com/sherlockode/user-confirmation-bundle

Symfony Bundle for the confirmation process of a user registration

  Sources   Download

MIT

The Requires

 

by Avatar sherlockode
by Neil Peyssard

18/05 2018

v0.2.1

0.2.1.0 https://github.com/sherlockode/user-confirmation-bundle

Bundle for the confirmation process of a user registration

  Sources   Download

MIT

The Requires

 

by Avatar sherlockode
by Neil Peyssard

18/05 2018

dev-fix/user_listener

dev-fix/user_listener https://github.com/sherlockode/user-confirmation-bundle

Bundle for the confirmation process of a user registration

  Sources   Download

MIT

The Requires

 

by Avatar sherlockode
by Neil Peyssard

18/05 2018

dev-fix/fos_version

dev-fix/fos_version https://github.com/sherlockode/user-confirmation-bundle

Bundle for the confirmation process of a user registration

  Sources   Download

MIT

The Requires

 

by Avatar sherlockode
by Neil Peyssard

18/05 2018

dev-fix/mail_sender

dev-fix/mail_sender https://github.com/sherlockode/user-confirmation-bundle

Bundle for the confirmation process of a user registration

  Sources   Download

MIT

The Requires

 

by Avatar sherlockode
by Neil Peyssard

16/05 2018

v0.2.0

0.2.0.0 https://github.com/sherlockode/user-confirmation-bundle

Bundle for the confirmation process of a user registration

  Sources   Download

MIT

The Requires

 

by Avatar sherlockode
by Neil Peyssard

21/02 2018

v0.1.0

0.1.0.0 https://github.com/sherlockode/user-confirmation-bundle

Bundle for the confirmation process of a user registration

  Sources   Download

MIT

The Requires

 

by Avatar sherlockode
by Neil Peyssard