PHPackages                             makraz/verify-email-change-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Mail &amp; Notifications](/categories/mail)
4. /
5. makraz/verify-email-change-bundle

ActiveSymfony-bundle[Mail &amp; Notifications](/categories/mail)

makraz/verify-email-change-bundle
=================================

Symfony bundle for secure email address changes with verification

2.1.0(2mo ago)013↓50%MITPHPPHP &gt;=8.1CI passing

Since Dec 1Pushed 2mo agoCompare

[ Source](https://github.com/makraz/verify-email-change-bundle)[ Packagist](https://packagist.org/packages/makraz/verify-email-change-bundle)[ RSS](/packages/makraz-verify-email-change-bundle/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (7)Dependencies (16)Versions (8)Used By (0)

Makraz Verify Email Change Bundle
=================================

[](#makraz-verify-email-change-bundle)

[![License](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](LICENSE) [![Tests](https://github.com/makraz/verify-email-change-bundle/workflows/Tests/badge.svg)](https://github.com/makraz/verify-email-change-bundle/actions)

A Symfony bundle that provides secure email address change functionality with verification.

Features
--------

[](#features)

- **Cryptographically Secure**: Uses selector + hashed token pattern to prevent timing attacks
- **Configurable Expiration**: Set custom lifetimes for verification links
- **Built-in Throttling**: Prevents abuse with configurable rate limiting
- **Flexible**: You control email sending, UI, and password verification
- **Twig Integration**: Built-in Twig functions for checking pending email changes
- **Max Verification Attempts**: Auto-invalidation after configurable failed attempts
- **Dual Verification Mode**: Optional confirmation from both old and new email addresses
- **CSRF Protection**: Built-in helper for cancel endpoint security
- **Email Notifications**: Built-in `EmailChangeNotifier` service with Twig templates
- **Translations**: Built-in translations for English, French, and Arabic
- **API/Headless Support**: JSON response factory for SPA and mobile app integration
- **OTP Verification**: Numeric code verification alternative to signed URLs
- **Audit Events**: Security-relevant events for logging and compliance
- **Pluggable Persistence**: Doctrine ORM, PSR-6 Cache, or in-memory adapters
- **Well Tested**: Comprehensive test suite with 480+ tests
- **Event-Driven**: Dispatches events for extensibility
- **Symfony Flex**: Auto-discovery support for seamless installation

Installation
------------

[](#installation)

```
composer require makraz/verify-email-change-bundle
```

The bundle supports **Symfony Flex auto-discovery** and will be registered automatically. If you're not using Flex, enable it manually:

```
// config/bundles.php
return [
    // ...
    Makraz\Bundle\VerifyEmailChange\MakrazVerifyEmailChangeBundle::class => ['all' => true],
];
```

Quick Start
-----------

[](#quick-start)

### Step 1: Update Your User Entity

[](#step-1-update-your-user-entity)

Your User entity must implement `EmailChangeableInterface`:

```
