Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- You have been registered as a teacher on XX.
- Please confirm your account
- <a href="http://localhost:3000/en/users/confirmation?confirmation_token=6Ac-y5Ymv1GNAkb5whUK">Confirm my account</a>
- and connect with these credentials log in:<br />
- login: bb@ee.fr<br />
- password:
- def new_teacher_registered(teacher, user = nil)
- @teacher = teacher
- @user = user
- @password = user.generate_password
- mail(from: 'XX', to: teacher.email, bcc: "YY", subject: 'You have been registered on XYZ')
- end
- <% if @user.ghost? %>
- You have been registered as a teacher on XXX.
- Please confirm your account
- <%= link_to "Confirm my account",
- confirmation_url(@user, I18n.locale, :confirmation_token => @user.confirmation_token) %>
- and connect with these credentials log in:<br />
- login: <%= @user.email %> <br />
- password: <%= @password %>
- <%else%>
- You have been registered on XX by <%= @teacher.studios.first.user.contact.location.name %>
- class User < ActiveRecord::Base
- .....
- def generate_password
- unless self.encrypted_password
- @password = Devise.friendly_token.first(8)
- if self.update(password: password, password_confirmation: password)
- @password
- else
- false
- end
- end
- end
- ......
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement