CoderDojoGitHub / our-dojo

Our dojo's website, used for archiving lesson plans and signing up students for classes
http://coderdojosf.com
5 stars 4 forks source link

"registration is open" emails? How does they work? #44

Closed mikefowler closed 10 years ago

mikefowler commented 10 years ago

Looked through the pieces of the application that I figured I'd see something in but I'm stumped. I see the RegistrationMailer and EventNotifier but nothing about timing and when to send them. Point me in the right direction, @jonmagic?

mikefowler commented 10 years ago

Followup: what time of day is registration set to open at? Had a question from a parent about it.

jonmagic commented 10 years ago

Two places to look: https://github.com/CoderDojoSF/our-dojo/blob/master/lib/tasks/hourly.rb and https://scheduler.heroku.com/dashboard (I just added you to the Heroku app) and https://github.com/CoderDojoSF/our-dojo/blob/master/app/models/event.rb#L102.

Those rake tasks get run hourly, so registration will open and notifications will be sent shortly after 10am this Saturday:

~/Projects/our-dojo (master) $ heroku run console
Running `console` attached to terminal... up, run.4754
Connecting to database specified by DATABASE_URL
[deprecated] I18n.enforce_available_locales will default to true in the future. If you really want to skip validation of your locale you can set I18n.enforce_available_locales = false to avoid this message.
Loading production environment (Rails 3.2.16)
irb(main):003:0> e = Event.last
  Event Load (4.1ms)  SELECT "events".* FROM "events" ORDER BY "events"."id" DESC LIMIT 1
=> #<Event id: 6, start_time: "2014-03-15 17:00:00", end_time: "2014-03-15 19:00:00", teacher_github_username: "jensechu", lesson_id: 5, location: "GitHub, 88 Colin P. Kelly Junior St., San Francisco...", created_at: "2014-02-27 18:03:44", updated_at: "2014-03-03 19:16:50", class_size: 30>
irb(main):004:0> e.start_time
=> Sat, 15 Mar 2014 10:00:00 PDT -07:00
irb(main):005:0> e.start_time - Event::DaysToOpenRegistrationBeforeEvent.days
=> Sat, 08 Mar 2014 10:00:00 PST -08:00
jonmagic commented 10 years ago

Registration emails just went out. There is one bug in them, they still link to coderdojosf.herokuapp.com (which works in addition to coderdojosf.com). Creating an issue to track that.

jonmagic commented 10 years ago

Fixed the url issue here https://github.com/CoderDojoSF/our-dojo/commit/a9ce361e3c33d29bc7feef3658f4ffebd9514c3c