barth / slacknewsletter
Self managed newsletter for Slack
Installs: 5
Dependents: 0
Suggesters: 0
Security: 0
Stars: 7
Watchers: 4
Forks: 1
Open Issues: 4
Type:project
Requires
- php: ^7.1.3
- ext-iconv: *
- embed/embed: ^3.3
- frlnc/php-slack: ^1.0
- league/flysystem: ^1.0
- nesbot/carbon: ^1.24
- symfony/console: *
- symfony/dotenv: *
- symfony/flex: ^1.0
- symfony/framework-bundle: *
- symfony/swiftmailer-bundle: ^3.2
- symfony/twig-bundle: ^4.0
- symfony/yaml: *
Requires (Dev)
- barth/dev-pack: ^1.0
- sensio/framework-extra-bundle: ^5.1
- sensiolabs/security-checker: ^4.1
- symfony/debug-pack: ^1.0
- symfony/maker-bundle: ^1.1
- symfony/var-dumper: ^4.0
- symfony/web-server-bundle: ^4.0
Conflicts
This package is auto-updated.
Last update: 2024-11-16 22:37:47 UTC
README
Slack Newsletter
This application allows you to generate a newsletter from your Slack channels. It goes through the channels looking for links, combines them into a html file, and sends it by email. It's ideal for keeping track of your finds when the historical Slack reaches its limit.
Installation & Configuration
-
Clone the project and launch
composer install
inside. -
Generate a Token on your slack workspace
-
In your
.env.local
, complete your smtp configuration, the receivers, and your Slack token like that :
MAILER_DSN=smtp://awesome-smtp:25
RECEIVERS=me@example.net,mailing-list@example.net
SLACK_TOKEN=xoxp-XXXXXXXXX-XXXXXXX-XXXXXXXXX
-
Choose your channels to browse and add them in
config/channels.json
. You can check out theconfig/channels.json.dist
to see how add a new channels -
(OPTIONNAL) : Pimp your newsletter by altering parameters in
config/package/parameters.yaml
-
Configure your cron to execute command to browse, build, and send newsletter.
For example :
## Every day at 8am, browse channels and store them 0 8 * * * php bin/console app:newsletter:browse ## Every monday at 8:05 am, build the newsletter and send it 5 8 * * 1 php bin/console app:newsletter:build && php bin/console app:newsletter:send
Build With
- Symfony 5.2
- symfony/console
- symfony/mailer
- symfony/yaml
- FlySystem from The Php League
- jolicode/slack-php-api
- Embed
- Carbon
Thank to theirs awesome work.
Customize the newsletter
If you want to customize the newsletter, all templates are in templates
folder.
Before testing rendering, you have to retrieve some messages :
php bin/console app:newsletter:browse -d 5
The
-d
or--days
is to specified how many days to retrieve. You can have lots of data by this way.
To test the view in web-browser, launch a web server :
symfony local:server:start -d # With Symfony CLI binary php -S localhost:8000 -t public # Using php built-in web-server
and go to http://127.0.0.1:8000/test/mail
But you probably have to send emails to test compatibility with emails viewer.
You can launch theses commands to avoid archivation of messages and builded news.
php bin/console app:newsletter:build --no-archive php bin/console app:newsletter:send --no-archive
Contribute
First of all, thank you for contributing ♥
If you find any typo/misconfiguration/... please send a PR or open an issue.
Also, while creating your PR, please write a description which gives the context and/or explains why you are creating it.
TODOs
- Make installation as simple as a
composer create-project barth/slacknewsletter
- Browse private channel
- Make sure it'll work with Slack App and provide a configuration guide
- Write Tests Suite
- Add translations
- Easily extend with other Team Collaboration Software (Discord, HipChat...)