# Scripting para activar el email de "Bienvenido" a nuevos usuarios

**URL:** <https://meta.discourse.org/t/scripting-to-trigger-welcome-email-to-new-users/37900>\
**Category:** Product Support\
**Created:** [13 Enero, 2016 17:43 UTC](https://meta.discourse.org/t/scripting-to-trigger-welcome-email-to-new-users/37900 "2016-01-13T17:43:21Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![gerhard](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gerhard/32/119479_2.png) [@gerhard](https://meta.discourse.org/u/gerhard)\
**Post date:** [13 Enero, 2016 19:05 UTC](https://meta.discourse.org/t/scripting-to-trigger-welcome-email-to-new-users/37900/10 "2016-01-13T19:05:49Z")

</div>

Something like this should work:

```ruby
User.where('created_at >= ?', 7.days.ago).find_each {|user| user.enqueue_welcome_message('welcome_user')}

```

It sends the welcome message to all users that where created within the last 7 days.

---

_[View the full topic](https://meta.discourse.org/t/scripting-to-trigger-welcome-email-to-new-users/37900)._
