heimrichhannot / contao-newsalert-bundle
A contao bundle to subscribe to news topics
Installs: 342
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 7
Forks: 1
Open Issues: 1
Type:contao-bundle
Requires
- php: ^8.0
- contao/core-bundle: ^4.13
- heimrichhannot/contao-formhybrid: ^3.2
- heimrichhannot/contao-utils-bundle: ^2.235.1
- symfony/dependency-injection: ^5.4 || ^6.0
- terminal42/notification_center: ^1.4.1
Conflicts
README
A contao bundle, to let website visitor subscribe to a news topic.
The bundle comes with an interface to add custom news topic, for example categories, tags, authors.
Features
- subscribe form module
- add custom topic sources
- send notifications to user subscribed to topics with notification center
- trigger send event via cronjob, poormancron or callback
- security features
- captcha in form field
- opt-in process after subscribe
- token secured opt-out links
- dublicate entry check
- when dublicate entry is not confirmed, resend activation link instead of showing error message
- archive informations about sent messages
- bundled topic source for news archives
Requirements
- Contao 4.13
- PHP 8
- Contao Notification Center ^1.4
- Formhybrid
Installation
Install via composer
composer require heimrichhannot/contao-newsalert-bundle
Afterwards call the Contao install procedure to update the database.
Setup
- add topic sources
- set up notification center notifications
hh_newsalert
for newsalert messagesformhybrid-opt-in
for opt-in mails
- add frontend registration module and configure it
- activate newsalert in news archive you want newsalert for
- optional: setup cronjob
Usage
The bundle adds a checkbox to news archive to activate (or deactivate) newsalert for archives. It also add a checkbox to the news articles form to set (or unset) an article sent (by setting unsent newsalert will be triggered again for said article).
The management of the receivers is placed within the news section (News -> Newsalert). The overview about sent messages is found withing the newsalert section (News -> Newsalert -> Sent Newsalerts)
Developers
Add topic source
To add a topic source, your topics class needs to implement the NewsTopicInterface
. With service autoconfiguration the class gets registered automatically.
Otherwise, has to be registered as service with the hh.newsalert.topic_source
tag.
Notification center tokens
ContaoNewsalertBundle uses Notification Center for e-mail sending. Following tokens are added to news_posted
type (in addition to the default ones):
Hooks
Frontend autocompletion
We recommend Chosen to add a search field to the topic select element. It's already used by Contao in the backend.
Commands
Setup triggger
You have 3 options:
Todo
- use caching for speed improvements?
- serverside topic validation
- cleanup function
- find duplicated
- find non-available topics
- Module selection for newsalert onsubmit