Ruby script to send automatic welcome message to new users

Great stuff!

Optimally you might consider packaging this as a plugin to avoid having to have a separate executable or script: Beginner's Guide to Creating Discourse Plugins Part 1: Creating 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.

https://github.com/discourse/discourse/blob/2ee144c27f78749aebc4fe97bc62a9fde6cf50c2/app/models/user.rb#L919

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

1 Like