Categoría: Ruby on Rails


Massive emailer

Noviembre 20th, 2009 — 2:04pm

Yesterday I did a talk at Xing offices in Barcelona. It was about some tips on how to send emails massively from a Ruby on Rails application without being tagged as a spammer by Hotmail, Gmail or Yahoo. I’m not a dedicated expert on this, but I’ve been learning these things while developing last internet site, and I thought it may be also interesting for other developers.
Here are the slides (in english) of the presentation, formerly named “Massive emailing with Linux, Postfix and Ruby on Rails“.

Here is the PDF for downloading.

Comentar » | Linux, Networking, Programación, Ruby on Rails

rubyonrails.org en parking!

Abril 23rd, 2009 — 5:03pm

DIOS!! esta es de las cosas más fuertes que he visto en internet en los últimos años… El dominio de Ruby On Rails (rubyonrails.org) está en parking!!

He mirado el registro del whois, y veo que el dominio ha caducado. Desde hoy mismo (23 de Abril 2009, día de Sant Jordi) pertenece a unos registradores masivos, de estos que te secuestran el dominio y luego te piden $15.000 por el.
Y desde luego la culpa no es de los bulk registers, sino del propietario anterior del dominio. Yo siempre me preocupo de renovar mis dominios antes de que caduquen.
Y es que en realidad el hecho de que se lo hayan quitado significa, no sólo que no se ha preocupado de renovarlo, sino que también se le ha pasado el periodo de redención (1 o 2 semanas, ahora no estoy seguro).

Bueno ahora la gran pregunta es dónde encontrar la documentación de la API, algo que uso a diario, y que ahora desde Gotapi no está disponible.

Qué es lo que ha pasado??? y ahora que????

EDIT: son las 20:31 y ya está funcionando again. No sé qué es lo que ha pasado, pero en 1 minuto se me ha venido el mundo encima. Se da uno cuenta de lo frágiles que somos, y lo delgada que es la cuerda sobre la que caminamos…

Comentar » | Programación, Ruby on Rails

Remove email confirmation on restful_authentication

Marzo 17th, 2009 — 6:56pm

SPANISH: Al considerar este artículo de interés común y dado que no he encontrado la explicación en ningún otro sitio, voy a redactarlo en inglés por si puede servir a alguien en un futuro. Si hay algo que no se entienda bien, no dudéis preguntármelo.

I’m working on an online app about auctions. A lot of the users coming to register don’t complete the email confirmation process, although I advise it in a red huge font at the login form. Most of the time I’m getting emils of users saying they registered but can’t login. When I look into the database, they didn’t activate their accounts.

Well, finally our CEO’s decided to remove the activation process. And this is when I’ve been googling for hours without luck, nobody explains the way to do it. Well no problem, it hasn’t been difficult at all. This is the way: a user is active if its activation_code in the database is Null.

  • Edit models/user.rb and remove this filter
    before_create :make_activation_code
    
  • In the same models/user.rb file, remove the activate method (we’re not activating any more user)
  • In the same models/user.rb file, remove the make_activation_code method (it’s almost at the end of the file).
  • Now edit controllers/users_controller.rb, remove completelly the activate method
  • In the same controller/users_controller.rb file, in the create mehod, set the activated_at time before saving the user
    @user = User.new(params[:user])
    @user.activated_at = Time.now.utc  # <--- add this line
        if @user.save
        [...]
    
  • Edit models/user_mailer.rb and completelly remove the activation method
  • Remove the file views/user_mailer/activation.html.rb
  • Edit the file views/user_mailer/signup_notification.html.erb and set the message as you like (variables are coming from models/user_mailer.rb)
  • Restart your app and test

I'm sure there are better ways, and I'm not the best coder in the world, but this way works for me. Maybe it will help someone one day...

Comentar » | Programación, Ruby on Rails

Volver arriba