PHPackages                             zazama/doubleoptin - 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. zazama/doubleoptin

ActiveSilverstripe-vendormodule[Mail &amp; Notifications](/categories/mail)

zazama/doubleoptin
==================

A Silverstripe 4 module to implement GDPR required E-Mail double-opt-in.

1.0.3(6y ago)21551[1 PRs](https://github.com/Zazama/DoubleOptIn/pulls)BSD-3-ClausePHPCI failing

Since Oct 21Pushed 5y ago1 watchersCompare

[ Source](https://github.com/Zazama/DoubleOptIn)[ Packagist](https://packagist.org/packages/zazama/doubleoptin)[ RSS](/packages/zazama-doubleoptin/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (4)Dependencies (3)Versions (5)Used By (0)

DoubleOptIn for Silverstripe
============================

[](#doubleoptin-for-silverstripe)

[![Packagist Version](https://camo.githubusercontent.com/9ef68ccc4bd5e814e81164d84cf4353b6d553791e959fdb73663d2e7feab82a5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f5a617a616d612f446f75626c654f7074496e3f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/9ef68ccc4bd5e814e81164d84cf4353b6d553791e959fdb73663d2e7feab82a5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f5a617a616d612f446f75626c654f7074496e3f7374796c653d666c61742d737175617265)[![GitHub](https://camo.githubusercontent.com/2fbf5ae5185b015074c394369b62e8749e57f9d88f02f7f4d5e8303e19fb05dc/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f5a617a616d612f446f75626c654f7074496e3f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/2fbf5ae5185b015074c394369b62e8749e57f9d88f02f7f4d5e8303e19fb05dc/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f5a617a616d612f446f75626c654f7074496e3f7374796c653d666c61742d737175617265)[![Scrutinizer code quality (GitHub/Bitbucket)](https://camo.githubusercontent.com/2a38c532e90ade9d5a9eaa6b48c7e310b2e68ae3a949313588fc31c423e91236/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f7175616c6974792f672f5a617a616d612f446f75626c654f7074496e3f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/2a38c532e90ade9d5a9eaa6b48c7e310b2e68ae3a949313588fc31c423e91236/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f7175616c6974792f672f5a617a616d612f446f75626c654f7074496e3f7374796c653d666c61742d737175617265)

Introduction
------------

[](#introduction)

DoubleOptIn extends Silverstripe and Userforms to implement a Double-Opt-In solution that is often required by new GDPR law. It will add a checkbox to Userforms to send a verification email before the submission/email is viewable/sent.

Requirements
------------

[](#requirements)

- silverstripe/framework ^4.0
- silverstripe/admin ^1.0
- silverstripe/userforms ^5.0

This module was only tested on the newest 4.4.

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

[](#installation)

```
composer require zazama/doubleoptin

```

### YAML configuration

[](#yaml-configuration)

```
# set a route for verification links
SilverStripe\Control\Director:
  rules:
    'verify': Zazama\DoubleOptIn\Controllers\VerificationController
Zazama\DoubleOptIn\Models\EmailVerification:
  url_segment: 'verify'
  # subject is ignored with Userforms, because that's set in admin frontend.
  subject: 'Email Verification'
# set sender for the verification email
Zazama\DoubleOptIn\Services\EmailSender:
  email_sender: 'example@yourdomain.com'
```

### Userforms settings

[](#userforms-settings)

- To enable DoubleOptIn in a Userforms page, go to the Configuration tab and click "Enable Double-Opt-In"
- Choose the Double-Opt-In E-Mail field (required, too)
- Enter your verification email subject.

### Usage with normal forms

[](#usage-with-normal-forms)

```
    use Zazama\DoubleOptIn\Models\EmailVerification;

    public function handleFormVerification($data, $subject) {
        $email = $data['email'];
        $emailVerification = EmailVerification::create();
        $emailVerification->init($email);
        $emailVerification->send($subject);
        $emailVerification->write();
    }

    public function tokenChecks() {
        EmailVerification::IsSuccess($token); //bool
        EmailVerification::IsAlreadyVerified($token); //bool
        EmailVerification::IsBadToken($token); //bool
        EmailVerification::TokenType($token); //string
    }
```

### Templates

[](#templates)

The following templates can be overriden:

- Zazama\\DoubleOptIn\\Layout\\Verification\_Success
- Zazama\\DoubleOptIn\\Layout\\Verification\_BadToken
- Zazama\\DoubleOptIn\\Layout\\Verification\_AlreadyVerified
- Zazama\\DoubleOptIn\\Email\\Email

If you just want to change the text, you can change the language strings.

### Extension hooks

[](#extension-hooks)

There are extension hooks provided to use the Verification controller.

```
class x extends Zazama\DoubleOptIn\Controllers\VerificationController {
  # called when successfully verified
  public function updateSuccess($token) {}

  # called when verification token is wrong / not provided
  public function updateBadToken() {}

  # called when verification token is already verified
  public function updateAlreadyVerified() {}
}

class y extends Zazama\DoubleOptIn\Models\EmailVerification {
  # change generated token
  public function updateGenerateToken($token) {}

  # change link
  public function updateLink($link) {}

  # change subject
  public function updateSubject($subject) {}
}
```

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~32 days

Total

4

Last Release

2300d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/7694808?v=4)[Jan Metzger](/maintainers/Zazama)[@Zazama](https://github.com/Zazama)

---

Top Contributors

[![Zazama](https://avatars.githubusercontent.com/u/7694808?v=4)](https://github.com/Zazama "Zazama (10 commits)")

---

Tags

emailsilverstripecmsgdprdouble-opt-in

### Embed Badge

![Health badge](/badges/zazama-doubleoptin/health.svg)

```
[![Health](https://phpackages.com/badges/zazama-doubleoptin/health.svg)](https://phpackages.com/packages/zazama-doubleoptin)
```

###  Alternatives

[silverstripe/cms

The SilverStripe Content Management System

5163.4M1.3k](/packages/silverstripe-cms)[unclecheese/silverstripe-permamail

Adds database storage of emails and CMS definition of email templates.

2014.8k](/packages/unclecheese-silverstripe-permamail)[friendsofsilverstripe/backendmessages

DRY way to create message boxes in SilverStripe backend.

1015.4k2](/packages/friendsofsilverstripe-backendmessages)[camfindlay/apes

The Automated Provision of Email Services (APES) module will allow you to set up an automated sync mechanism between the SilverStripe Member DataObject and MailChimp.

122.6k](/packages/camfindlay-apes)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
