Skip to content
This repository has been archived by the owner on Oct 24, 2024. It is now read-only.

Announce new Reddit Modmail using a Slack Webhook

Notifications You must be signed in to change notification settings

oranges13/RedditModmailSlack

Repository files navigation

Reddit Modmail Slack Notifier

A microservice which fetches a list of unread modmail messages from Reddit based on criteria you specify and then posts it using an incoming webhook to your slack channel!

Build Status

System Requirements

This application is built on the Lumen Framework and has the same installation requirements:

  • PHP >= 7.1.3
  • OpenSSL PHP Extension
  • PDO PHP Extension
  • Mbstring PHP Extension

Installation

Download the most recent release and expand the archive into your webserver root directory, or clone the release branch.

In the application base directory, run composer install. (For production use add the --no-dev flag).

Copy .env.example to .env and fill out the required configuration variables.

Usage

Quickstart

Send a GET request to the root of the application to run the service manually or you can use the artisan command artisan fetch:modmail {state}.

State is an optional parameter (which defaults to 'new') which can be used to filter the request for modmail.

Automatic Scheduling

This application includes an artisan command that can be run on the schedule you desire.

If you wish to enable this functionality, you only need to uncomment the schedule line in app/Console/Commands/Kernel.php

Be sure to add the following cron entry to your server in order to run the scheduler once configured:

* * * * * cd /path-to-your-project && php artisan schedule:run >> /dev/null 2>&1

If enabled, by default this task will run every 10 minutes. You can view the available schedule frequencies in the official Laravel documentation

You can add constraints for the schedule or optionally add notifications on failure. All of these options are documented in the task Scheduling overview in the official Laravel Documentation

Contributing

Bugfixes and improvements are welcome. Please submit issues using the template provided!