PHPackages                             truongwp/email - 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. truongwp/email

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

truongwp/email
==============

Abstract class for email sending in WordPress

1.1.0(8y ago)220GPLv2 or laterPHPPHP &gt;=5.3.0

Since Aug 25Pushed 8y ago1 watchersCompare

[ Source](https://github.com/truongwp/email)[ Packagist](https://packagist.org/packages/truongwp/email)[ RSS](/packages/truongwp-email/feed)WikiDiscussions master Synced 5d ago

READMEChangelogDependencies (1)Versions (4)Used By (0)

An abstract class for email sending in WordPress.

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

[](#installation)

Use composer to include the library:

`composer require truongwp/email="*"`

Usage
-----

[](#usage)

```
/**
 * Class ExampleEmail
 */
class ExampleEmail extends Truongwp\Email {

	/**
	 * Whether to use HTML in email.
	 *
	 * @var bool
	 */
	protected $html = true;

	/**
	 * Gets email subject.
	 *
	 * @return string
	 */
	protected function subject() {
		return 'Example email subject';
	}

	/**
	 * Gets email content body.
	 *
	 * @return string
	 */
	protected function content_body() {
		return 'Hi %%customer_name%%.This is an example email from %%site_name%%';
	}

	/**
	 * Gets email content footer.
	 *
	 * @return string
	 */
	protected function content_footer() {
		if ( $this->html ) {
			return 'Best Regards,Truongwp';
		}

		return "Best Regards,\nTruongwp";
	}

	/**
	 * Gets css for email content.
	 *
	 * @return string
	 */
	protected function content_css() {
		return '.red { color: red; }';
	}
}

$email = new ExampleEmail();
$email->replace( '%%customer_name%%', 'Truong' );
$email->send( 'truongwp@gmail.com' );
```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity60

Established project with proven stability

 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.

###  Release Activity

Cadence

Every ~3 days

Total

3

Last Release

3181d ago

Major Versions

0.1.1 → 1.0.02017-08-25

### Community

Maintainers

![](https://www.gravatar.com/avatar/84b3fdebb6a6415de5105c942a8229485df485bac660664e3f4985ebf697fbae?d=identicon)[truongwp](/maintainers/truongwp)

---

Top Contributors

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

---

Tags

emailemail-senderwordpress

### Embed Badge

![Health badge](/badges/truongwp-email/health.svg)

```
[![Health](https://phpackages.com/badges/truongwp-email/health.svg)](https://phpackages.com/packages/truongwp-email)
```

###  Alternatives

[snowfire/beautymail

Send beautiful html emails with Laravel

1.3k733.1k2](/packages/snowfire-beautymail)[dachcom-digital/emailizr

Pimcore Emailizr - create html emails the right way!

17370.2k4](/packages/dachcom-digital-emailizr)[markguinn/silverstripe-email-helpers

Silverstripe extension containing SMTP mailer class and some other classes for HTML emails

3145.4k1](/packages/markguinn-silverstripe-email-helpers)[sandstorm/templatemailer

Neos and Flow package for simple handling of template-based emails, including CSS inlining

1147.3k2](/packages/sandstorm-templatemailer)[mediaessenz/mail

Powerful newsletter system for TYPO3

119.1k2](/packages/mediaessenz-mail)

PHPackages © 2026

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