vouchedfor/consent-bundle

Provides support for email opt-in/out consent management via DynamoDb

dev-master 2022-10-17 08:33 UTC

This package is auto-updated.

Last update: 2024-05-17 12:04:06 UTC


README

Provides a mechanism for managing email consent via AWS DynamoDb

Installation

Install it with composer:

composer require vouchedfor/consent-bundle:dev-master

Then, add the following in your AppKernel bundles:

// app/AppKernel.php
public function registerBundles()
{
    $bundles = array(
        ...
        new VouchedFor\ConsentBundle\VouchedForConsentBundle(),
        ...
    );
    ...
}

Add the name of the consent table in DynamoDB to config.yml. For example:

// app/config/config.yml
vouched_for_consent:
    table_name: consent
    password: secretpasswordforemailencryption

Example Usage

    $consentHandler = $this->get('vouchedfor_consent');

    $encryptedEmail = $consentHandler->encrypt('info@test.com');
    
    $services = [
        'marketing_emails': true,
        'service_emails': true,
        'third_party_emails: false
    ];

    $consentHandler->update($encryptedEmail, '2018-01-03 12:30:12', $services);

License

The Consent Bundle is free to use and is licensed under the MIT license