I need to run a simple script daily with specific parameters like this. When I run it manually:
bundle exec rails runner auto_send_messages_script.rb --messages-limit 3 --sleep-timer 5 --marker welcome_back_campaign_2025 --order-type created_at ā-order desc
I see no errors and everything is fine, Iām new to Ruby and wonder if there is an easy way to run this script and interact with Discourse.
1 Like
merefield
(Robert)
2
The Discourse (and Rails) way of doing this would be to create a plugin and run it as a scheduled (sidekiq) Job.
There are loads of plugins with Jobs, have a look through them.
3 Likes
supermathie
(Michael Brown)
3
From an application-development point of view:

From a systems point of view:
Easiest thing to do is run it on the host.
3 Likes