PHPackages                             ikknd/mail-center - 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. ikknd/mail-center

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

ikknd/mail-center
=================

Mail center

031PHP

Since Dec 11Pushed 12y ago1 watchersCompare

[ Source](https://github.com/ikknd/MailCenter)[ Packagist](https://packagist.org/packages/ikknd/mail-center)[ RSS](/packages/ikknd-mail-center/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependenciesVersions (2)Used By (0)

MailCenter
==========

[](#mailcenter)

1. Initialization
    --

In order to use MailCenter you will need to call Mailing class.

```
$mailing = new \MailCenter\Mailing($config, $type, $options, $emails);
$mailing->run();
```

---

$config is a stdClass.

Example $config:

```
$config = new stdClass();
$config->siteurl = ‘http://www.test.loc’;
$config->host = ‘localhost’;
$config->port = ‘3306’;
$config->dbname = ‘test’;
$config->username = ‘root’;
$config->password = ‘root’;
$config->path = ‘/../mailcenter’;      /*Path to Mailings described in section 2*/
$config->options = array('someVar'=>'data');
```

---

$type – is a name of your mailing, it will be used to find Mailing files described in section 2

Example $type:

```
$type = ‘appsale’;
```

---

$options - is an optional array of options that will be made available to DataProvider

Example $options:

```
$options = array('appId'=>1);
```

---

$emails – is an optional array of emails that mailing will be sent to. If $emails is set to null, UserProvider will look for emails in database, using $type attribute to find users signed up for this mailing.

Example $emails:

```
$emails = array(
    				0=>array(
    					'email'=>'test@test.com',
    					'username'=>'test'
    				)
    			)
OR
$emails = null;
```

2 Mailings
----------

[](#2-mailings)

If MailCenter folder is core of the project itself, then Mailings are specific implementations. Mailings can be located anywhere in your project and are separate from MailCenter core, but path to Mailings folder needs to be specified in $config-&gt;path, when initializing MailCenter.

Mailings follow this file\\naming structure:

```
  {mailingFolder}
    - Data
      -- {MailingName}Data.php
    - Mailing
      -- {MailingName}Mailing.php
    - Template
      -- {MailingName}Template.php
```

So if you specified $type = 'appsale', like described in section 1, MailCenter would look for AppsaleData.php, AppsaleMailing.php and AppsaleTemplate.php

---

{MailingName}Data.php

```
use MailCenter\Data\DataInterface;

class AppsaleData implements DataInterface
{
    /**
     * @param $db \PDO
     * @param array $options
     * @return array
     */
    public static function getData($db, $options)
    {
        $data = ... \*Code to fetch data using $db - PDO object*\

        return $data;
    }
}
```

---

{MailingName}Mailing.php

```
use MailCenter\Mailing\MailingAbstract;
use MailCenter\Template\TemplateProvider;
use MailCenter\Sender\SenderProvider;

class AppsaleMailing extends MailingAbstract
{
    public function getConfig()
    {
        $config = new \stdClass();
        $config->subject = 'Appsale Daily Newsletter';
        $config->storage = TemplateProvider::STORAGE_TYPE_FILE;
        $config->engine = TemplateProvider::ENGINE_TYPE_PHP;
        $config->sender = SenderProvider::TYPE_MANDRILL;

        return $config;
    }
}
```

Available Senders are - SenderProvider::TYPE\_MANDRILL and SenderProvider::TYPE\_SENDMAIL

---

{MailingName}Template.php

An html email template.

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

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/e3054c4590a4a0ca9c4c453a7f852c61f09ccc367c7c4d3ebffd971b7bc90f1b?d=identicon)[ikknd](/maintainers/ikknd)

### Embed Badge

![Health badge](/badges/ikknd-mail-center/health.svg)

```
[![Health](https://phpackages.com/badges/ikknd-mail-center/health.svg)](https://phpackages.com/packages/ikknd-mail-center)
```

###  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)
