Ruby script om automatisch welkomstbericht te sturen naar nieuwe gebruikers

AI-generated summary

michaelhenderson shared a Ruby script that automatically sends welcome messages to new users on a Discourse forum. The script currently requires manual setup with API credentials and is triggered via task scheduler or cron job, though michaelhenderson plans to turn it into an executable for easier use. merefield praised the script and suggested packaging it as a Discourse plugin instead, which would integrate more seamlessly with the platform. merefield also recommended using Discourse’s built-in event system — specifically the after_create callback in the User model — to trigger welcome messages automatically upon user creation, eliminating the need for scheduled tasks. Alternatively, if scheduling is preferred, merefield noted that Discourse supports custom scheduled jobs via plugins, with documentation available for reference. The script is available on GitHub: DiscourseWelcomeMessage.

Hello, community! been a while since I posted but I hope everyone is doing well. I wanted to share with you a ruby script I created that automatically sends a welcome message to new users that join your discourse forum.

I plan to make it into an actual executable so it’s easier to work with for people who don’t want to dig into code but right now I simply plug in my api and username into the script and then use task scheduler or a cron tab to point to the script and execute it daily.

Enjoy :slight_smile:

https://github.com/m-henderson/DiscourseWelcomeMessage

Great stuff!

Optimally you might consider packaging this as a plugin to avoid having to have a separate executable or script: Developing Discourse Plugins - Part 1 - Create a basic plugin

Architecturally you might also consider using out-of-the-box Discourse Events to capture the moment when you’d like to send a user a message - this would avoid scheduling anything.

But if you need it Discourse also has a great scheduler and there are plenty of plugins that create bespoke ‘Jobs’. Scheduling jobs from a plugin - #2 by simon