Advertisement
Guest User

Untitled

a guest
Oct 10th, 2016
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. You have been registered as a teacher on XX.
  2. Please confirm your account
  3.  
  4. <a href="http://localhost:3000/en/users/confirmation?confirmation_token=6Ac-y5Ymv1GNAkb5whUK">Confirm my account</a>
  5. and connect with these credentials log in:<br />
  6. login: bb@ee.fr<br />
  7. password:
  8.  
  9. def new_teacher_registered(teacher, user = nil)
  10. @teacher = teacher
  11. @user = user
  12. @password = user.generate_password
  13. mail(from: 'XX', to: teacher.email, bcc: "YY", subject: 'You have been registered on XYZ')
  14. end
  15.  
  16. <% if @user.ghost? %>
  17. You have been registered as a teacher on XXX.
  18. Please confirm your account
  19.  
  20. <%= link_to "Confirm my account",
  21. confirmation_url(@user, I18n.locale, :confirmation_token => @user.confirmation_token) %>
  22.  
  23. and connect with these credentials log in:<br />
  24. login: <%= @user.email %> <br />
  25. password: <%= @password %>
  26.  
  27. <%else%>
  28. You have been registered on XX by <%= @teacher.studios.first.user.contact.location.name %>
  29.  
  30. class User < ActiveRecord::Base
  31. .....
  32. def generate_password
  33. unless self.encrypted_password
  34. @password = Devise.friendly_token.first(8)
  35. if self.update(password: password, password_confirmation: password)
  36. @password
  37. else
  38. false
  39. end
  40. end
  41. end
  42. ......
  43. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement