Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/smichaelsen/typo3-noti
The Notification API for *your* TYPO3 extension
https://github.com/smichaelsen/typo3-noti
Last synced: 30 days ago
JSON representation
The Notification API for *your* TYPO3 extension
- Host: GitHub
- URL: https://github.com/smichaelsen/typo3-noti
- Owner: smichaelsen
- Created: 2016-10-05T14:05:26.000Z (about 8 years ago)
- Default Branch: main
- Last Pushed: 2024-11-21T11:16:43.000Z (about 1 month ago)
- Last Synced: 2024-11-21T12:23:23.793Z (about 1 month ago)
- Language: PHP
- Size: 225 KB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Noti
## Your TYPO3 notification API
Sending an email notification for a certain event is very common requirement for extension developers and of course it's not that hard.
Using the TYPO3 `MailMessage` class you'll be done in a few minutes.But wait.. the client wants to configure the recipient mail addresses? Don't rack your brain where to put the configuration. Use Noti!
## What does it do?Using noti an extension can trigger an event like "A new user registered", "we received a new product rating", "the daily data import went wrong".
In the TYPO3 backend you can create subscription records for those events.
![Backend form screenshot](/Documentation/Screenshots/example_backend_form.png?raw=true)
Right now there are two notification types available:
### Email NotificationLet's you configure a list of mail addresses that receive a notification when the event is triggered.
### Slack Notification
Sends a message to our favorite chat app when the event is triggered.
## How do I implement it in my extension?
In your `ext_localconf.php` register your event:
````
\Smichaelsen\Noti\EventRegistry::registerEvent(
(new \Smichaelsen\Noti\Domain\Model\Event('myUniqueEventIdentifier', $_EXTKEY))
->setTitle('New user registered') // LLL reference is possible and recommended here
->addPlaceholder('userName', 'The user name') // This will appear in the backend to show the available placeholders to the user
);
````Then in your code trigger the event like this:
````
EventRegistry::triggerEvent(
'myUniqueEventIdentifier',
[
'userName' => $newUser->getUsername(),
]
);
````