{"id":23709522,"url":"https://github.com/arraypress/edd-register-email-tags","last_synced_at":"2026-02-25T21:01:53.245Z","repository":{"id":269281572,"uuid":"906943010","full_name":"arraypress/edd-register-email-tags","owner":"arraypress","description":"A streamlined library for managing and registering custom email tags in Easy Digital Downloads (EDD), making email template customization more intuitive and maintainable.","archived":false,"fork":false,"pushed_at":"2024-12-23T13:49:08.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-07T15:04:17.127Z","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}},"created_at":"2024-12-22T11:29:24.000Z","updated_at":"2024-12-23T13:49:11.000Z","dependencies_parsed_at":null,"dependency_job_id":"728ffa0f-a3ea-4ded-8fd2-8ae63453b28d","html_url":"https://github.com/arraypress/edd-register-email-tags","commit_stats":null,"previous_names":["arraypress/edd-register-email-tags"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/arraypress/edd-register-email-tags","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arraypress%2Fedd-register-email-tags","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arraypress%2Fedd-register-email-tags/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arraypress%2Fedd-register-email-tags/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arraypress%2Fedd-register-email-tags/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arraypress","download_url":"https://codeload.github.com/arraypress/edd-register-email-tags/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arraypress%2Fedd-register-email-tags/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29839932,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-25T20:42:33.054Z","status":"ssl_error","status_checked_at":"2026-02-25T20:42:21.322Z","response_time":61,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":"2024-12-30T18:56:45.625Z","updated_at":"2026-02-25T21:01:53.240Z","avatar_url":"https://github.com/arraypress.png","language":"PHP","readme":"# EDD Email Tags Library\n\nA 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.\n\n## Features\n\n- 📧 **Email Tag Management**: Easily register and manage EDD email tags\n- 🏗️ **Fluent Builder Interface**: Intuitive tag configuration with method chaining\n- ⚡ **WordPress Integration**: Seamless integration with EDD's email system\n- 🛡️ **Type Safety**: Full type hinting and strict types enforcement\n- 🔄 **Context Awareness**: Support for context-specific tag processing\n- 🎯 **Recipient Filtering**: Control tag visibility based on recipient types\n- 🚦 **Error Handling**: Robust error handling with debug logging\n- 🏭 **Factory Pattern**: Efficient tag creation and registration\n- 🔌 **Plugin Support**: Easy integration with existing plugins\n- ✨ **Clean API**: Simple and intuitive API design\n\n## Requirements\n\n- PHP 7.4 or later\n- WordPress 5.0 or later\n- Easy Digital Downloads plugin\n- Composer (for installation)\n\n## Installation\n\nInstall via Composer:\n\n```bash\ncomposer require arraypress/edd-email-tags\n```\n\n## Basic Usage\n\n```php\nuse ArrayPress\\EDD\\Register\\EmailTags;\n\n// Initialize the factory with your plugin file\n$tags = EmailTags::register( __FILE__ );\n\n// Register a simple email tag\n$tags-\u003etag( 'customer_name' )\n     -\u003edescription( 'The customer\\'s full name' )\n     -\u003ecallback( function( $payment_id ) {\n         $payment = edd_get_payment( $payment_id );\n         return $payment ? $payment-\u003eget_name() : '';\n     } )\n     -\u003eregister();\n```\n\n## Extended Examples\n\n### Creating Tags with Custom Context\n\n```php\n$tags-\u003etag( 'subscription_status' )\n     -\u003edescription( 'The status of the subscription' )\n     -\u003elabel( 'Subscription Status' )\n     -\u003econtexts( ['subscription', 'renewal'] )\n     -\u003ecallback( function( $email_object_id, $email_object = null, $email = null ) {\n         return $email_object-\u003eget_status_label();\n     } )\n     -\u003eregister();\n```\n\n### Adding Context-Aware Tags\n\n```php\n$tags-\u003etag( 'order_currency' )\n     -\u003edescription( 'The currency used for the order' )\n     -\u003econtexts( ['order'] )\n     -\u003ecallback( function( $email_object_id, $email_object = null, $email = null ) {\n         return $email_object-\u003ecurrency;\n     } )\n     -\u003eregister();\n```\n\n### Working with Multiple Tags\n\n```php\n// Register multiple tags at once\n$tags-\u003etag( 'customer_name' )\n     -\u003edescription( 'The customer\\'s full name' )\n     -\u003ecallback( function( $email_object_id, $email_object = null, $email = null ) {\n         return $email_object-\u003eget_name();\n     } )\n     -\u003eregister()\n     \n     -\u003etag( 'payment_status' )\n     -\u003edescription( 'The payment status' )\n     -\u003ecallback( function( $email_object_id, $email_object = null, $email = null ) {\n         return $email_object-\u003estatus_nicename;\n     } )\n     -\u003eregister();\n```\n\n## API Methods\n\n### EmailTags Factory Methods\n\n* `register( string $file )`: Create/get factory instance for a plugin\n* `get_by( string $file )`: Get all registered tags for a plugin\n* `tag( string $tag )`: Create a new tag builder\n* `add_tag( EmailTag $tag )`: Add a tag to the factory\n* `register_tags()`: Register all tags with EDD\n\n### TagBuilder Methods\n\n* `description( string $description )`: Set tag description\n* `label( string $label )`: Set tag label\n* `callback( callable $callback )`: Set tag callback\n* `contexts( array $contexts )`: Set allowed contexts\n* `recipients( array $recipients )`: Set allowed recipients\n* `register()`: Build and register the tag\n\n### EmailTag Methods\n\n* `get_tag()`: Get tag identifier\n* `get_description()`: Get tag description\n* `get_label()`: Get tag label\n* `get_contexts()`: Get allowed contexts\n* `get_recipients()`: Get allowed recipients\n* `get_callback()`: Get wrapped callback function\n* `get_raw_callback()`: Get original unwrapped callback\n\n## Use Cases\n\n* **Order Information**: Display order-specific details in emails\n* **Customer Data**: Include customer information in notifications\n* **Subscription Details**: Show subscription status and information\n* **Custom Notifications**: Create specialized email content\n* **Admin Communications**: Include admin-specific information\n* **Dynamic Content**: Generate context-aware email content\n* **Conditional Display**: Show content based on recipient type\n* **Payment Information**: Include payment-specific details\n* **Product Details**: Display purchased item information\n* **System Integration**: Connect with other plugin systems\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## License\n\nThis project is licensed under the GPL-2.0-or-later License.\n\n## Support\n\n- [Documentation](https://github.com/arraypress/edd-email-tags)\n- [Issue Tracker](https://github.com/arraypress/edd-email-tags/issues)","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farraypress%2Fedd-register-email-tags","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farraypress%2Fedd-register-email-tags","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farraypress%2Fedd-register-email-tags/lists"}