PHPackages                             arraypress/edd-register-email-tags - 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. arraypress/edd-register-email-tags

ActiveLibrary[Mail &amp; Notifications](/categories/mail)

arraypress/edd-register-email-tags
==================================

A streamlined library for managing and registering custom email tags in Easy Digital Downloads (EDD), making email template customization more intuitive and maintainable.

061PHP

Since Dec 11Pushed 5mo ago1 watchersCompare

[ Source](https://github.com/arraypress/edd-register-email-tags)[ Packagist](https://packagist.org/packages/arraypress/edd-register-email-tags)[ RSS](/packages/arraypress-edd-register-email-tags/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

EDD Email Tags Library
======================

[](#edd-email-tags-library)

A PHP library for easy registration and management of Easy Digital Downloads (EDD) email tags, providing a fluent builder interface and robust tag handling. Features type safety, error handling, and context-aware tag processing.

Features
--------

[](#features)

- 📧 **Email Tag Management**: Easily register and manage EDD email tags
- 🏗️ **Fluent Builder Interface**: Intuitive tag configuration with method chaining
- ⚡ **WordPress Integration**: Seamless integration with EDD's email system
- 🛡️ **Type Safety**: Full type hinting and strict types enforcement
- 🔄 **Context Awareness**: Support for context-specific tag processing
- 🎯 **Recipient Filtering**: Control tag visibility based on recipient types
- 🚦 **Error Handling**: Robust error handling with debug logging
- 🏭 **Factory Pattern**: Efficient tag creation and registration
- 🔌 **Plugin Support**: Easy integration with existing plugins
- ✨ **Clean API**: Simple and intuitive API design

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

[](#requirements)

- PHP 7.4 or later
- WordPress 5.0 or later
- Easy Digital Downloads plugin
- Composer (for installation)

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

[](#installation)

Install via Composer:

```
composer require arraypress/edd-email-tags
```

Basic Usage
-----------

[](#basic-usage)

```
use ArrayPress\EDD\Register\EmailTags;

// Initialize the factory with your plugin file
$tags = EmailTags::register( __FILE__ );

// Register a simple email tag
$tags->tag( 'customer_name' )
     ->description( 'The customer\'s full name' )
     ->callback( function( $payment_id ) {
         $payment = edd_get_payment( $payment_id );
         return $payment ? $payment->get_name() : '';
     } )
     ->register();
```

Extended Examples
-----------------

[](#extended-examples)

### Creating Tags with Custom Context

[](#creating-tags-with-custom-context)

```
$tags->tag( 'subscription_status' )
     ->description( 'The status of the subscription' )
     ->label( 'Subscription Status' )
     ->contexts( ['subscription', 'renewal'] )
     ->callback( function( $email_object_id, $email_object = null, $email = null ) {
         return $email_object->get_status_label();
     } )
     ->register();
```

### Adding Context-Aware Tags

[](#adding-context-aware-tags)

```
$tags->tag( 'order_currency' )
     ->description( 'The currency used for the order' )
     ->contexts( ['order'] )
     ->callback( function( $email_object_id, $email_object = null, $email = null ) {
         return $email_object->currency;
     } )
     ->register();
```

### Working with Multiple Tags

[](#working-with-multiple-tags)

```
// Register multiple tags at once
$tags->tag( 'customer_name' )
     ->description( 'The customer\'s full name' )
     ->callback( function( $email_object_id, $email_object = null, $email = null ) {
         return $email_object->get_name();
     } )
     ->register()

     ->tag( 'payment_status' )
     ->description( 'The payment status' )
     ->callback( function( $email_object_id, $email_object = null, $email = null ) {
         return $email_object->status_nicename;
     } )
     ->register();
```

API Methods
-----------

[](#api-methods)

### EmailTags Factory Methods

[](#emailtags-factory-methods)

- `register( string $file )`: Create/get factory instance for a plugin
- `get_by( string $file )`: Get all registered tags for a plugin
- `tag( string $tag )`: Create a new tag builder
- `add_tag( EmailTag $tag )`: Add a tag to the factory
- `register_tags()`: Register all tags with EDD

### TagBuilder Methods

[](#tagbuilder-methods)

- `description( string $description )`: Set tag description
- `label( string $label )`: Set tag label
- `callback( callable $callback )`: Set tag callback
- `contexts( array $contexts )`: Set allowed contexts
- `recipients( array $recipients )`: Set allowed recipients
- `register()`: Build and register the tag

### EmailTag Methods

[](#emailtag-methods)

- `get_tag()`: Get tag identifier
- `get_description()`: Get tag description
- `get_label()`: Get tag label
- `get_contexts()`: Get allowed contexts
- `get_recipients()`: Get allowed recipients
- `get_callback()`: Get wrapped callback function
- `get_raw_callback()`: Get original unwrapped callback

Use Cases
---------

[](#use-cases)

- **Order Information**: Display order-specific details in emails
- **Customer Data**: Include customer information in notifications
- **Subscription Details**: Show subscription status and information
- **Custom Notifications**: Create specialized email content
- **Admin Communications**: Include admin-specific information
- **Dynamic Content**: Generate context-aware email content
- **Conditional Display**: Show content based on recipient type
- **Payment Information**: Include payment-specific details
- **Product Details**: Display purchased item information
- **System Integration**: Connect with other plugin systems

Contributing
------------

[](#contributing)

Contributions are welcome! Please feel free to submit a Pull Request.

License
-------

[](#license)

This project is licensed under the GPL-2.0-or-later License.

Support
-------

[](#support)

- [Documentation](https://github.com/arraypress/edd-email-tags)
- [Issue Tracker](https://github.com/arraypress/edd-email-tags/issues)

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance49

Moderate activity, may be stable

Popularity5

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity12

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/cd6eb8aff0903d87eb674d1ba3c5f3653899c0d7661504eb0deb7798ed86b643?d=identicon)[arraypress](/maintainers/arraypress)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/arraypress-edd-register-email-tags/health.svg)

```
[![Health](https://phpackages.com/badges/arraypress-edd-register-email-tags/health.svg)](https://phpackages.com/packages/arraypress-edd-register-email-tags)
```

###  Alternatives

[tijsverkoyen/css-to-inline-styles

CssToInlineStyles is a class that enables you to convert HTML-pages/files into HTML-pages/files with inline styles. This is very useful when you're sending emails.

5.8k505.3M227](/packages/tijsverkoyen-css-to-inline-styles)[minishlink/web-push

Web Push library for PHP

1.9k12.0M53](/packages/minishlink-web-push)[laravel-notification-channels/twilio

Provides Twilio notification channel for Laravel

2587.7M12](/packages/laravel-notification-channels-twilio)[spatie/url-signer

Generate a url with an expiration date and signature to prevent unauthorized access

4422.3M16](/packages/spatie-url-signer)[mattketmo/email-checker

Throwaway email detection library

2742.0M5](/packages/mattketmo-email-checker)[laravel-notification-channels/discord

Laravel notification driver for Discord.

2371.3M11](/packages/laravel-notification-channels-discord)

PHPackages © 2026

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