heimrichhannot / contao-newsalert
A contao module to subscribe to news topics
Installs: 90
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 6
Forks: 0
Open Issues: 0
Type:contao-module
Requires
- php: ~7.0
- contao-community-alliance/composer-plugin: ~2.4 || ~3.0
- contao/core-bundle: ~3.5.1 || ^4.4
- heimrichhannot/contao-formhybrid: ^3.3
- terminal42/notification_center: ^1.4
README
Contao 3 backport from Contao Newsalert Bundle
A contao module, to let website visitor subscribe to a news topic.
The module 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
- use contao cron to trigger send
- 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 3.5
- PHP >= 7.0
- Contao Notification Center
- Formhybrid
Installation
Install via composer
composer require heimrichhannot/contao-newsalert
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
Cronjob
For performance reasons, we insist on disabling the "Command-Scheduler" in Settings (enable tl_settings.disableCron
) and run the cron jobs by a dedicated cronjob within your servers crontab.
Contao 3:
* * * * * wget -O /dev/null -q https://[DOMAIN-NAME]/system/cron/cron.php --no-check-certificate
Usage
The module 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 overview about sent messages is placed within the news archive section (News -> Newsalert). The management of the receivers is found withing the newsalert section (News -> Newsalert -> Newsalert receivers)
Developers
Add topic source
To add a topic source, your topics class needs to implement the NewsTopicInterface
and has to be registered within $GLOBALS['HUH_NEWSALERT']['TOPIC_SOURCE']
.
Example:
$GLOBALS['HUH_NEWSALERT']['TOPIC_SOURCE']['newsarchives'] = \HeimrichHannot\ContaoNewsAlertBundle\Components\NewsArchiveTopics::class;
Notification center tokens
ContaoNewsalert 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.