{"id":20961820,"url":"https://github.com/heimrichhannot/contao-newsalert-bundle","last_synced_at":"2025-05-14T07:31:06.279Z","repository":{"id":46667057,"uuid":"99333358","full_name":"heimrichhannot/contao-newsalert-bundle","owner":"heimrichhannot","description":"A contao bundle to subscribe to news topics.","archived":false,"fork":false,"pushed_at":"2024-04-22T13:52:02.000Z","size":185,"stargazers_count":1,"open_issues_count":1,"forks_count":1,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-17T13:54:43.418Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/heimrichhannot.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2017-08-04T10:40:36.000Z","updated_at":"2024-04-22T13:52:00.000Z","dependencies_parsed_at":"2024-02-29T13:03:56.756Z","dependency_job_id":null,"html_url":"https://github.com/heimrichhannot/contao-newsalert-bundle","commit_stats":{"total_commits":94,"total_committers":5,"mean_commits":18.8,"dds":0.0957446808510638,"last_synced_commit":"c82dd7bddcc2ad900d75b86ff5b91a95e99a04ad"},"previous_names":[],"tags_count":34,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heimrichhannot%2Fcontao-newsalert-bundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heimrichhannot%2Fcontao-newsalert-bundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heimrichhannot%2Fcontao-newsalert-bundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heimrichhannot%2Fcontao-newsalert-bundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/heimrichhannot","download_url":"https://codeload.github.com/heimrichhannot/contao-newsalert-bundle/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254094857,"owners_count":22013649,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-19T02:17:42.337Z","updated_at":"2025-05-14T07:31:03.849Z","avatar_url":"https://github.com/heimrichhannot.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Contao Newsalert Bundle\n[![Latest Stable Version](https://poser.pugx.org/heimrichhannot/contao-newsalert-bundle/v/stable)](https://packagist.org/packages/heimrichhannot/contao-newsalert-bundle)\n[![Total Downloads](https://poser.pugx.org/heimrichhannot/contao-newsalert-bundle/downloads)](https://packagist.org/packages/heimrichhannot/contao-newsalert-bundle)\n[![Travis](https://img.shields.io/travis/heimrichhannot/contao-newsalert-bundle.svg)](https://travis-ci.org/heimrichhannot/contao-newsalert-bundle)\n[![Coveralls github](https://img.shields.io/coveralls/github/heimrichhannot/contao-newsalert-bundle.svg)](https://coveralls.io/github/heimrichhannot/contao-newsalert-bundle)\n\nA contao bundle, to let website visitor subscribe to a news topic.\n\nThe bundle comes with an interface to add custom news topic, for example categories, tags, authors.\n\n## Features\n* subscribe form module\n* add custom topic sources\n* send notifications to user subscribed to topics with notification center\n* trigger send event via cronjob, poormancron or callback\n* security features\n    * captcha in form field\n    * opt-in process after subscribe\n    * token secured opt-out links\n* dublicate entry check\n    * when dublicate entry is not confirmed, resend activation link instead of showing error message\n* archive informations about sent messages\n* bundled topic source for news archives\n\n\n## Requirements\n\n* Contao 4.13\n* PHP 8\n* [Contao Notification Center](https://github.com/terminal42/contao-notification_center) ^1.4\n* [Formhybrid](https://github.com/heimrichhannot/contao-formhybrid)\n\n## Installation\n\nInstall via composer\n\n```\ncomposer require heimrichhannot/contao-newsalert-bundle\n```\n\nAfterwards call the Contao install procedure to update the database.\n\n## Setup\n\n* add topic sources\n* set up notification center notifications\n    * `hh_newsalert` for newsalert messages\n    * `formhybrid-opt-in` for opt-in mails\n* add frontend registration module and configure it\n* activate newsalert in news archive you want newsalert for\n* optional: setup cronjob\n\n## Usage\n\nThe 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).\n\nThe management of the receivers is placed within the news section (News -\u003e Newsalert).\nThe overview about sent messages is found withing the newsalert section (News -\u003e Newsalert -\u003e Sent Newsalerts)\n\n## Developers\n\n### Add topic source\n\nTo add a topic source, your topics class needs to implement the `NewsTopicInterface`. With service autoconfiguration the class gets registered automatically.\nOtherwise, has to be registered as service with the `hh.newsalert.topic_source` tag.\n\n### Notification center tokens\nContaoNewsalertBundle uses Notification Center for e-mail sending. Following tokens are added to `news_posted` type (in addition to the default ones): \n\nTag                                   | Description\n--------------------------------------|-----------\n##huh_newsalert_topic_recipient##      | Emailaddress of the subscriber\n##huh_newsalert_news_headline##        | Title of the news for which newsalert is triggered\n##huh_newsalert_news_subheadline##     | SUbheadline of the news for which newsalert is triggered\n##huh_newsalert_news_teaser##          | Teaser text of the news article\n##huh_newsalert_news_content##         | Article content\n##huh_newsalert_news_url##             | Relative url to the article\n##huh_newsalert_recipient_topics##     | The intersection of news topics and subscribed topics of the receiver\n##huh_newsalert_recipient_topic_count##| The the number of topics from ##hh_newsalert_recipient_topics##\n##huh_newsalert_opt_out_html##         | A list of all recipients topics and the corresponding unsubscribe links in html format (Topic: Link)\n##huh_newsalert_opt_out_text##         | Same list as above, but textonly\n##huh_newsalert_year##                 | The current year\n##huh_newsalert_root_url##             | Root url\n\n### Hooks\n\nName                     | Arguments                                            | Expected return value | Description\n-------------------------|------------------------------------------------------|-----------------------|------------\nhuh_newsalert_customToken |NewsModel $objArticle, array $arrTokens, DC_Table $dc | $arrTokens            | Hook to add custom tokens or manipulate existing ones. Don't forget to register them via your config.php file.\n\n### Frontend autocompletion\nWe recommend [Chosen](https://harvesthq.github.io/chosen/) to add a search field to the topic select element. It's already used by Contao in the backend.\n\n### Commands\n\nName              | Options                              | Description \n------------------|--------------------------------------|-------------\nhuh:newsalert:send|--limit=0: Max number of news articles|Checks for unsend newsalert.\n\n### Setup triggger\n\nYou have 3 options:\n\nOption | Description\n-------|------------\npoorManCron|Poor man cron is the contao own cronjob system. You can choose the intervall in the module settings.\ncronJob|You can setup your own cronjob. Just trigger the send command (see Commands)\nonSubmit|Trigger newsalert for a news, which is saved. This is **not** recommend, because the onsubmit event is triggered before saving! So the article may not be finished when event is triggered!\n\n## Todo\n* use caching for speed improvements?\n* serverside topic validation\n* cleanup function\n    * find duplicated\n    * find non-available topics\n* Module selection for newsalert onsubmit\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheimrichhannot%2Fcontao-newsalert-bundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fheimrichhannot%2Fcontao-newsalert-bundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheimrichhannot%2Fcontao-newsalert-bundle/lists"}