PHPackages                             arraypress/wp-register-emails - 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. [Templating &amp; Views](/categories/templating)
4. /
5. arraypress/wp-register-emails

ActiveLibrary[Templating &amp; Views](/categories/templating)

arraypress/wp-register-emails
=============================

A comprehensive WordPress email registration and templating system with component builders, tag processing, and visual templates.

110PHP

Since Feb 7Pushed 3mo agoCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

WordPress Email Registration System
===================================

[](#wordpress-email-registration-system)

A declarative email system for WordPress that combines dynamic tags, component-based templates, and a simple registration API. Build professional transactional emails with 21+ components and automatic tag processing.

Features
--------

[](#features)

- **Tag-Based System**: Register dynamic placeholders that get replaced with real data
- **21+ Email Components**: Buttons, tables, invoices, shipping trackers, subscription status, and more
- **7 Professional Templates**: Default, invoice, notification, dark mode, and more
- **Smart Currency Handling**: Automatic formatting for all Stripe currencies
- **Theme Override Support**: Customize templates via your WordPress theme

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

[](#installation)

```
composer require arraypress/wp-register-emails
```

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

[](#quick-start)

### 1. Register Tags (Dynamic Content)

[](#1-register-tags-dynamic-content)

```
// Text replacement
register_email_tag( 'shop', 'customer_name', [
	'type'     => 'text',
	'label'    => 'Customer Name',
	'callback' => fn( $order ) => $order->billing_name
] );

// Button component
register_email_tag( 'shop', 'view_order_btn', [
	'type'     => 'button',
	'label'    => 'View Order Button',
	'callback' => fn( $order ) => [
		'text' => 'View Order #' . $order->id,
		'url'  => 'https://example.com/order/' . $order->id
	]
] );

// Invoice table with currency
register_email_tag( 'shop', 'invoice', [
	'type'     => 'order_items',
	'callback' => fn( $order ) => [
		'items'    => [
			[ 'name' => 'Premium Plugin', 'quantity' => 1, 'price' => 9900 ]
		],
		'tax'      => 990,
		'shipping' => 500,
		'currency' => 'USD'
	]
] );
```

### 2. Register Templates

[](#2-register-templates)

```
register_email_template( 'shop', 'order_confirmation', [
	'label'    => 'Order Confirmation',
	'subject'  => 'Order #{order_id} Confirmed',
	'template' => 'invoice',  // Visual template
	'message'  => '
        Hi {customer_name},
        Thank you for your order!
        {invoice}
        {view_order_btn}
    '
] );
```

### 3. Send Emails

[](#3-send-emails)

```
send_email_template( 'shop', 'order_confirmation', [
	'to'   => 'customer@example.com',
	'data' => $order
] );
```

Available Components
--------------------

[](#available-components)

### Commerce &amp; Orders

[](#commerce--orders)

```
// Invoice with totals
register_email_tag( 'shop', 'invoice', [
	'type'     => 'order_items',
	'callback' => fn( $order ) => [
		'items'    => [ ... ],
		'currency' => 'USD',
		'tax'      => 1000,
		'discount' => 500
	]
] );

// Shipping tracker
register_email_tag( 'shop', 'tracking', [
	'type'     => 'shipping_tracker',
	'callback' => fn( $order ) => [
		'carrier'         => 'FedEx',
		'tracking_number' => '123456789',
		'status'          => 'In Transit',
		'steps'           => [
			[ 'label' => 'Shipped', 'completed' => true ],
			[ 'label' => 'In Transit', 'completed' => false ]
		]
	]
] );

// Subscription status
register_email_tag( 'shop', 'subscription', [
	'type'     => 'subscription_status',
	'callback' => fn( $user ) => [
		'plan'              => 'Premium',
		'status'            => 'Active',
		'amount'            => 9900,
		'currency'          => 'USD',
		'next_billing_date' => '2025-02-01'
	]
] );
```

### Content &amp; Display

[](#content--display)

```
// Alert boxes
register_email_tag( 'system', 'warning', [
	'type'     => 'alert',
	'callback' => fn() => [
		'message' => 'Payment method expires soon',
		'type'    => 'warning'  // success|error|warning|info
	]
] );

// Progress bars
register_email_tag( 'system', 'progress', [
	'type'     => 'progress_bar',
	'callback' => fn( $data ) => [
		'current' => $data->completed,
		'total'   => $data->total,
		'label'   => 'Processing'
	]
] );

// Stats grid
register_email_tag( 'metrics', 'stats', [
	'type'     => 'stats_grid',
	'callback' => fn() => [
		'stats' => [
			[ 'value' => '1,234', 'label' => 'Orders' ],
			[ 'value' => '$12,345', 'label' => 'Revenue' ],
			[ 'value' => '98%', 'label' => 'Satisfaction' ]
		]
	]
] );
```

WooCommerce Example
-------------------

[](#woocommerce-example)

```
add_action( 'init', function () {
	// Register tags
	register_email_tag( 'woo', 'order_number', [
		'type'     => 'text',
		'callback' => fn( $order ) => $order->get_order_number()
	] );

	register_email_tag( 'woo', 'order_table', [
		'type'     => 'order_items',
		'callback' => function ( $order ) {
			$items = [];
			foreach ( $order->get_items() as $item ) {
				$items[] = [
					'name'     => $item->get_name(),
					'quantity' => $item->get_quantity(),
					'price'    => $item->get_total() * 100 // Convert to cents
				];
			}

			return [
				'items'    => $items,
				'tax'      => $order->get_total_tax() * 100,
				'shipping' => $order->get_shipping_total() * 100,
				'currency' => $order->get_currency()
			];
		}
	] );

	// Register template
	register_email_template( 'woo', 'order_confirmation', [
		'label'    => 'Order Confirmation',
		'subject'  => 'Order #{order_number} Received',
		'template' => 'invoice',
		'message'  => '
            Thank you for your order!
            Order #{order_number} has been received.
            {order_table}
            We will notify you when it ships.
        '
	] );
} );

// Send on order placement
add_action( 'woocommerce_thankyou', function ( $order_id ) {
	send_email_template( 'woo', 'order_confirmation', [
		'to'   => $order->get_billing_email(),
		'data' => wc_get_order( $order_id )
	] );
} );
```

Templates
---------

[](#templates)

TemplateDescriptionBest For`default`Clean with colored headerWelcome emails, marketing`invoice`Minimal Apple-inspiredReceipts, confirmations`notification`Simple borderedSystem alerts`plain`Text-focusedTechnical emails`dark`Dark modeModern apps`soft`Gentle gradientsSaaS products`mono`Black &amp; whiteFormal notices### Custom Templates

[](#custom-templates)

Place templates in your theme:

```
/wp-content/themes/your-theme/register-emails/custom.html

```

All Components
--------------

[](#all-components)

- **Text**: `text`, `raw_html`, `divider`, `spacer`
- **Interactive**: `button`, `alert`, `info_box`, `coupon`
- **Data**: `table`, `order_items`, `key_value_list`, `stats_grid`, `progress_bar`
- **Commerce**: `product_list`, `downloads_list`, `shipping_tracker`, `subscription_status`
- **User**: `activity_log`, `event_details`, `reward_balance`, `testimonial`

Global Tags
-----------

[](#global-tags)

Always available in any template:

- `{site_name}` - WordPress site name
- `{site_url}` - Site URL
- `{admin_email}` - Admin email
- `{year}` - Current year
- `{date}` - Current date

Advanced Features
-----------------

[](#advanced-features)

### Tag Groups

[](#tag-groups)

```
// Register tags to multiple groups
register_email_tag( 'shop', 'price', [
	'type'     => 'text',
	'groups'   => [ 'invoices', 'quotes' ],  // Available in multiple contexts
	'callback' => fn( $data ) => format_currency( $data->amount, $data->currency )
] );
```

### Preview Mode

[](#preview-mode)

```
// Generate preview with sample data
$html = preview_email_template( 'shop', 'order_confirmation' );

// Preview with specific data
$html = preview_email_template( 'shop', 'order_confirmation', $sample_order );
```

### Settings Integration

[](#settings-integration)

```
register_email_template( 'shop', 'welcome', [
	'settings_callback' => function () {
		// Pull from your settings
		return [
			'enabled' => get_option( 'welcome_email_enabled' ),
			'subject' => get_option( 'welcome_email_subject' ),
			'message' => get_option( 'welcome_email_content' )
		];
	},
	'default_settings'  => [
		'subject' => 'Welcome to {site_name}!',
		'message' => 'Thank you for joining us.'
	]
] );
```

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

[](#requirements)

- PHP 7.4 or later
- WordPress 5.0 or later

License
-------

[](#license)

GPL-2.0-or-later

Credits
-------

[](#credits)

Created by [David Sherlock](https://davidsherlock.com) at [ArrayPress](https://arraypress.com)

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance54

Moderate activity, may be stable

Popularity7

Limited adoption so far

Community6

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 (10 commits)")

### Embed Badge

![Health badge](/badges/arraypress-wp-register-emails/health.svg)

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

###  Alternatives

[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[whitecube/nova-flexible-content

Flexible Content &amp; Repeater Fields for Laravel Nova.

8053.0M25](/packages/whitecube-nova-flexible-content)[mopa/bootstrap-bundle

Easy integration of twitters bootstrap into symfony2

7042.9M33](/packages/mopa-bootstrap-bundle)[limenius/react-bundle

Client and Server-side react rendering in a Symfony Bundle

3871.2M](/packages/limenius-react-bundle)[nicmart/string-template

StringTemplate is a very simple string template engine for php. I've written it to have a thing like sprintf, but with named and nested substutions.

2101.7M30](/packages/nicmart-string-template)[symfony/ux-icons

Renders local and remote SVG icons in your Twig templates.

545.8M69](/packages/symfony-ux-icons)

PHPackages © 2026

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