# Ruby script to send automatic welcome message to new users

**URL:** https://meta.discourse.org/t/ruby-script-to-send-automatic-welcome-message-to-new-users/178665
**Category:** Development
**Created:** [February 6, 2021, 4:43pm UTC](https://meta.discourse.org/t/ruby-script-to-send-automatic-welcome-message-to-new-users/178665 "2021-02-06T16:43:06Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![michaelhenderson](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/michaelhenderson/32/76069_2.png) [@michaelhenderson](https://meta.discourse.org/u/michaelhenderson)
#### Post date: [February 6, 2021, 4:43pm UTC](https://meta.discourse.org/t/ruby-script-to-send-automatic-welcome-message-to-new-users/178665/1 "2021-02-06T16:43:06Z")

</div>

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 🙂

[https://github.com/m-henderson/DiscourseWelcomeMessage](https://github.com/m-henderson/DiscourseWelcomeMessage)

---

<div class="post-metadata">

### Author: ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)
#### Post date: [February 9, 2021, 4:23pm UTC](https://meta.discourse.org/t/ruby-script-to-send-automatic-welcome-message-to-new-users/178665/6 "2021-02-09T16:23:23Z")

</div>

Great stuff!

> [@michaelhenderson](#):
>
> I plan to make it into an actual executable

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](https://meta.discourse.org/t/beginners-guide-to-creating-discourse-plugins-part-1/30515)

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](https://meta.discourse.org/t/scheduling-jobs-from-a-plugin/40238/2)
