Created
October 21, 2012 18:21
-
-
Save mscoutermarsh/3927973 to your computer and use it in GitHub Desktop.
Send user email in their timezone
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Set zone to the users time zone | |
Time.zone = user.time_zone | |
# convert time to UTC | |
user_time_to_utc = Time.zone.parse('2012-10-22 09:25:00').utc | |
puts "Scheduling for #{user.login} at #{user_time_to_utc}" | |
# Schedule the sidekiq job | |
SendPromoEmail.perform_at(user_time_to_utc,user.id) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment