Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class UserMailer < ApplicationMailer
- def notificacion_evento_email(user, tutorando, tipo_destinatario)
- if !user.nil? &&!tipo_destinatario.nil? && !tutorando.nil? && !tutorando.empty?
- if Rails.env == 'production'
- begin
- if tipo_destinatario == 1
- @email = user.email
- @subject = 'Has registrado una cita de tutoría'
- @message = "Has registrado un nuevo seguimiento de tutoría del día #{tutorando['fecha']} para el alumno #{tutorando['nombre']}."
- elsif tipo_destinatario == 2
- @email = "#{tutorando['matricula'][0].strip}@uach.mx"
- @subject = 'Se registro una cita de tutoría'
- @message = "El tutor #{user.full_name} ha registrado un nuevo seguimiento de tutoría del día #{tutorando['fecha']}."
- end
- mail(to: @email, subject: @subject)
- rescue => e
- Debug.exception e, 'notificacion_evento_email'
- end
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement