PHPackages                             jandanielcz/simona - 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. jandanielcz/simona

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

jandanielcz/simona
==================

Simple language used to specify when and to whom to send notifications.

1.1.1(9y ago)013[1 issues](https://github.com/jandanielcz/simona/issues)MITPHP

Since Mar 8Pushed 9y ago1 watchersCompare

[ Source](https://github.com/jandanielcz/simona)[ Packagist](https://packagist.org/packages/jandanielcz/simona)[ RSS](/packages/jandanielcz-simona/feed)WikiDiscussions master Synced today

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

Simona
======

[](#simona)

*Simple language used to specify when and to whom send notifications.*

Purpose
-------

[](#purpose)

For one side project (project management/IS/KB mix) I needed flexible but simple way to configure when should users get notifications for their tasks.

For example:

- Notify responsible user one week and 3 days before if task is not done yet.
- If task is one day delayed notify supervisor.
- If task is more than 3 days delayed notify all admins.

Than I can every night check all recent and future task, process these rules and send emails.

Examples
--------

[](#examples)

Notify responsible user one week before:

```
(1):[responsible];

```

If task is one day delayed notify supervisor:

```
(-1!):[supervisor];

```

If task is more than 3 days delayed notify all admins.:

```
(-3..!):@admins;

```

We can combine rules to create simple escalation scenarios:

```
(7):[responsible];
(1!):[responsible];
(-1..!):[responsible];
(-2!):[supervisor],@admins;
(-3!):tom@example.org;

```

Lines not starting with `(` and space after trailing `;` can be used for comments.

```
(7):[responsible];
(1!):[responsible];
(-1..!):[responsible];      keep bugging him :)
(-2!):[supervisor],@admins;

Tom from example corp. wants to know about it since 2017-01. Adam.
(-3!):tom@example.org;

```

Rule elements
-------------

[](#rule-elements)

1. time window definition
2. `!` send notifications only if task is unsolved
3. `:` separator
4. list of recipients separated by `,` for my usage i decided to go with
    - specific email `dan@example.org`
    - relation to task `[responsible]`
    - user group `@itdept`
    - other `plain_string` (not used)
5. trailing `;`

Each rule should be on separate line.

#### Interval specification

[](#interval-specification)

For definition of days for notification Simone uses days count to task date:

```

                    Day of task
        ...3  2  1  0 -1 -2 -3 -4...
--------------------|--------------------time-->

(..!)   ...X  X  X  X  X  X  X  X        every day until done
(2..-1)       X  X  X  X
(0..!)              X  X  X...           until done
(3)        X                             once

```

Negative numbers means task should be done in histoy.

Errors
------

[](#errors)

If line starts with `(` it is considered rule and invalid rules, should be reported to user. Every other line is ignored in processing.

PHP Usage
---------

[](#php-usage)

### Basic usage

[](#basic-usage)

```
$rc = new RulesCollection();
$rc->parse('(1):a;');
$rc->whoToNotify(1, false); // $daysToTask, $isTaskCompleted?

// returns ['a']
```

### Usage with recipient types

[](#usage-with-recipient-types)

```
$rc = new RulesCollection();
$rc->parse('(1):[a],@allUsers;');
$rc->setRecipientReducer(['\JanDanielCz\Simona\RecipientUtils','groupRelMailPlainReducer']);
$rc->whoToNotify(1, false); // $daysToTask, $isTaskCompleted?

/*
returns [
    'group' => ['allUsers'],
    'rel' => ['a'],
    'mail' => [],
    'plain' => []
    ];
*/
```

You can create your own reducer to sort recipients and introduce any special recipients syntax.

Limitations
-----------

[](#limitations)

Spaces inside recipient definition are removed before parsing by `preg_replace('/\s+/', '', $string)` pull request with better regex is welcomed.

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity65

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 ~0 days

Total

3

Last Release

3401d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/219847?v=4)[jandanielcz](/maintainers/jandanielcz)[@jandanielcz](https://github.com/jandanielcz)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/jandanielcz-simona/health.svg)

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

###  Alternatives

[mattketmo/email-checker

Throwaway email detection library

2752.1M5](/packages/mattketmo-email-checker)[sarfraznawaz2005/noty

Laravel package to incorporate noty flash notifications into laravel.

324.5k](/packages/sarfraznawaz2005-noty)

PHPackages © 2026

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