{"id":34017245,"url":"https://github.com/arraypress/wp-register-emails","last_synced_at":"2026-06-01T00:31:38.767Z","repository":{"id":336915124,"uuid":"1101879249","full_name":"arraypress/wp-register-emails","owner":"arraypress","description":"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.","archived":false,"fork":false,"pushed_at":"2026-02-06T19:11:49.000Z","size":78,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-07T03:59:12.111Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/arraypress.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-22T12:10:55.000Z","updated_at":"2026-02-06T19:11:52.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/arraypress/wp-register-emails","commit_stats":null,"previous_names":["arraypress/wp-register-emails"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/arraypress/wp-register-emails","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arraypress%2Fwp-register-emails","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arraypress%2Fwp-register-emails/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arraypress%2Fwp-register-emails/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arraypress%2Fwp-register-emails/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arraypress","download_url":"https://codeload.github.com/arraypress/wp-register-emails/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arraypress%2Fwp-register-emails/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33755369,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-31T02:00:06.040Z","response_time":95,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-12-13T14:29:26.747Z","updated_at":"2026-06-01T00:31:38.762Z","avatar_url":"https://github.com/arraypress.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WordPress Email Registration System\n\nA 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.\n\n## Features\n\n* **Tag-Based System**: Register dynamic placeholders that get replaced with real data\n* **21+ Email Components**: Buttons, tables, invoices, shipping trackers, subscription status, and more\n* **7 Professional Templates**: Default, invoice, notification, dark mode, and more\n* **Smart Currency Handling**: Automatic formatting for all Stripe currencies\n* **Theme Override Support**: Customize templates via your WordPress theme\n\n## Installation\n\n```bash\ncomposer require arraypress/wp-register-emails\n```\n\n## Quick Start\n\n### 1. Register Tags (Dynamic Content)\n\n```php\n// Text replacement\nregister_email_tag( 'shop', 'customer_name', [\n\t'type'     =\u003e 'text',\n\t'label'    =\u003e 'Customer Name',\n\t'callback' =\u003e fn( $order ) =\u003e $order-\u003ebilling_name\n] );\n\n// Button component\nregister_email_tag( 'shop', 'view_order_btn', [\n\t'type'     =\u003e 'button',\n\t'label'    =\u003e 'View Order Button',\n\t'callback' =\u003e fn( $order ) =\u003e [\n\t\t'text' =\u003e 'View Order #' . $order-\u003eid,\n\t\t'url'  =\u003e 'https://example.com/order/' . $order-\u003eid\n\t]\n] );\n\n// Invoice table with currency\nregister_email_tag( 'shop', 'invoice', [\n\t'type'     =\u003e 'order_items',\n\t'callback' =\u003e fn( $order ) =\u003e [\n\t\t'items'    =\u003e [\n\t\t\t[ 'name' =\u003e 'Premium Plugin', 'quantity' =\u003e 1, 'price' =\u003e 9900 ]\n\t\t],\n\t\t'tax'      =\u003e 990,\n\t\t'shipping' =\u003e 500,\n\t\t'currency' =\u003e 'USD'\n\t]\n] );\n```\n\n### 2. Register Templates\n\n```php\nregister_email_template( 'shop', 'order_confirmation', [\n\t'label'    =\u003e 'Order Confirmation',\n\t'subject'  =\u003e 'Order #{order_id} Confirmed',\n\t'template' =\u003e 'invoice',  // Visual template\n\t'message'  =\u003e '\n        \u003cp\u003eHi {customer_name},\u003c/p\u003e\n        \u003cp\u003eThank you for your order!\u003c/p\u003e\n        {invoice}\n        {view_order_btn}\n    '\n] );\n```\n\n### 3. Send Emails\n\n```php\nsend_email_template( 'shop', 'order_confirmation', [\n\t'to'   =\u003e 'customer@example.com',\n\t'data' =\u003e $order\n] );\n```\n\n## Available Components\n\n### Commerce \u0026 Orders\n```php\n// Invoice with totals\nregister_email_tag( 'shop', 'invoice', [\n\t'type'     =\u003e 'order_items',\n\t'callback' =\u003e fn( $order ) =\u003e [\n\t\t'items'    =\u003e [ ... ],\n\t\t'currency' =\u003e 'USD',\n\t\t'tax'      =\u003e 1000,\n\t\t'discount' =\u003e 500\n\t]\n] );\n\n// Shipping tracker\nregister_email_tag( 'shop', 'tracking', [\n\t'type'     =\u003e 'shipping_tracker',\n\t'callback' =\u003e fn( $order ) =\u003e [\n\t\t'carrier'         =\u003e 'FedEx',\n\t\t'tracking_number' =\u003e '123456789',\n\t\t'status'          =\u003e 'In Transit',\n\t\t'steps'           =\u003e [\n\t\t\t[ 'label' =\u003e 'Shipped', 'completed' =\u003e true ],\n\t\t\t[ 'label' =\u003e 'In Transit', 'completed' =\u003e false ]\n\t\t]\n\t]\n] );\n\n// Subscription status\nregister_email_tag( 'shop', 'subscription', [\n\t'type'     =\u003e 'subscription_status',\n\t'callback' =\u003e fn( $user ) =\u003e [\n\t\t'plan'              =\u003e 'Premium',\n\t\t'status'            =\u003e 'Active',\n\t\t'amount'            =\u003e 9900,\n\t\t'currency'          =\u003e 'USD',\n\t\t'next_billing_date' =\u003e '2025-02-01'\n\t]\n] );\n```\n\n### Content \u0026 Display\n```php\n// Alert boxes\nregister_email_tag( 'system', 'warning', [\n\t'type'     =\u003e 'alert',\n\t'callback' =\u003e fn() =\u003e [\n\t\t'message' =\u003e 'Payment method expires soon',\n\t\t'type'    =\u003e 'warning'  // success|error|warning|info\n\t]\n] );\n\n// Progress bars\nregister_email_tag( 'system', 'progress', [\n\t'type'     =\u003e 'progress_bar',\n\t'callback' =\u003e fn( $data ) =\u003e [\n\t\t'current' =\u003e $data-\u003ecompleted,\n\t\t'total'   =\u003e $data-\u003etotal,\n\t\t'label'   =\u003e 'Processing'\n\t]\n] );\n\n// Stats grid\nregister_email_tag( 'metrics', 'stats', [\n\t'type'     =\u003e 'stats_grid',\n\t'callback' =\u003e fn() =\u003e [\n\t\t'stats' =\u003e [\n\t\t\t[ 'value' =\u003e '1,234', 'label' =\u003e 'Orders' ],\n\t\t\t[ 'value' =\u003e '$12,345', 'label' =\u003e 'Revenue' ],\n\t\t\t[ 'value' =\u003e '98%', 'label' =\u003e 'Satisfaction' ]\n\t\t]\n\t]\n] );\n```\n\n## WooCommerce Example\n\n```php\nadd_action( 'init', function () {\n\t// Register tags\n\tregister_email_tag( 'woo', 'order_number', [\n\t\t'type'     =\u003e 'text',\n\t\t'callback' =\u003e fn( $order ) =\u003e $order-\u003eget_order_number()\n\t] );\n\n\tregister_email_tag( 'woo', 'order_table', [\n\t\t'type'     =\u003e 'order_items',\n\t\t'callback' =\u003e function ( $order ) {\n\t\t\t$items = [];\n\t\t\tforeach ( $order-\u003eget_items() as $item ) {\n\t\t\t\t$items[] = [\n\t\t\t\t\t'name'     =\u003e $item-\u003eget_name(),\n\t\t\t\t\t'quantity' =\u003e $item-\u003eget_quantity(),\n\t\t\t\t\t'price'    =\u003e $item-\u003eget_total() * 100 // Convert to cents\n\t\t\t\t];\n\t\t\t}\n\n\t\t\treturn [\n\t\t\t\t'items'    =\u003e $items,\n\t\t\t\t'tax'      =\u003e $order-\u003eget_total_tax() * 100,\n\t\t\t\t'shipping' =\u003e $order-\u003eget_shipping_total() * 100,\n\t\t\t\t'currency' =\u003e $order-\u003eget_currency()\n\t\t\t];\n\t\t}\n\t] );\n\n\t// Register template\n\tregister_email_template( 'woo', 'order_confirmation', [\n\t\t'label'    =\u003e 'Order Confirmation',\n\t\t'subject'  =\u003e 'Order #{order_number} Received',\n\t\t'template' =\u003e 'invoice',\n\t\t'message'  =\u003e '\n            \u003ch2\u003eThank you for your order!\u003c/h2\u003e\n            \u003cp\u003eOrder #{order_number} has been received.\u003c/p\u003e\n            {order_table}\n            \u003cp\u003eWe will notify you when it ships.\u003c/p\u003e\n        '\n\t] );\n} );\n\n// Send on order placement\nadd_action( 'woocommerce_thankyou', function ( $order_id ) {\n\tsend_email_template( 'woo', 'order_confirmation', [\n\t\t'to'   =\u003e $order-\u003eget_billing_email(),\n\t\t'data' =\u003e wc_get_order( $order_id )\n\t] );\n} );\n```\n\n## Templates\n\n| Template | Description | Best For |\n|----------|-------------|----------|\n| `default` | Clean with colored header | Welcome emails, marketing |\n| `invoice` | Minimal Apple-inspired | Receipts, confirmations |\n| `notification` | Simple bordered | System alerts |\n| `plain` | Text-focused | Technical emails |\n| `dark` | Dark mode | Modern apps |\n| `soft` | Gentle gradients | SaaS products |\n| `mono` | Black \u0026 white | Formal notices |\n\n### Custom Templates\n\nPlace templates in your theme:\n```\n/wp-content/themes/your-theme/register-emails/custom.html\n```\n\n## All Components\n\n* **Text**: `text`, `raw_html`, `divider`, `spacer`\n* **Interactive**: `button`, `alert`, `info_box`, `coupon`\n* **Data**: `table`, `order_items`, `key_value_list`, `stats_grid`, `progress_bar`\n* **Commerce**: `product_list`, `downloads_list`, `shipping_tracker`, `subscription_status`\n* **User**: `activity_log`, `event_details`, `reward_balance`, `testimonial`\n\n## Global Tags\n\nAlways available in any template:\n* `{site_name}` - WordPress site name\n* `{site_url}` - Site URL\n* `{admin_email}` - Admin email\n* `{year}` - Current year\n* `{date}` - Current date\n\n## Advanced Features\n\n### Tag Groups\n```php\n// Register tags to multiple groups\nregister_email_tag( 'shop', 'price', [\n\t'type'     =\u003e 'text',\n\t'groups'   =\u003e [ 'invoices', 'quotes' ],  // Available in multiple contexts\n\t'callback' =\u003e fn( $data ) =\u003e format_currency( $data-\u003eamount, $data-\u003ecurrency )\n] );\n```\n\n### Preview Mode\n```php\n// Generate preview with sample data\n$html = preview_email_template( 'shop', 'order_confirmation' );\n\n// Preview with specific data\n$html = preview_email_template( 'shop', 'order_confirmation', $sample_order );\n```\n\n### Settings Integration\n```php\nregister_email_template( 'shop', 'welcome', [\n\t'settings_callback' =\u003e function () {\n\t\t// Pull from your settings\n\t\treturn [\n\t\t\t'enabled' =\u003e get_option( 'welcome_email_enabled' ),\n\t\t\t'subject' =\u003e get_option( 'welcome_email_subject' ),\n\t\t\t'message' =\u003e get_option( 'welcome_email_content' )\n\t\t];\n\t},\n\t'default_settings'  =\u003e [\n\t\t'subject' =\u003e 'Welcome to {site_name}!',\n\t\t'message' =\u003e 'Thank you for joining us.'\n\t]\n] );\n```\n\n## Requirements\n\n- PHP 7.4 or later\n- WordPress 5.0 or later\n\n## License\n\nGPL-2.0-or-later\n\n## Credits\n\nCreated by [David Sherlock](https://davidsherlock.com) at [ArrayPress](https://arraypress.com)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farraypress%2Fwp-register-emails","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farraypress%2Fwp-register-emails","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farraypress%2Fwp-register-emails/lists"}