Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mentee_emails = ["manaranjanfav@gmail.com","mridul.sharma@iitgn.ac.in","nitingovilkar97@gmail.com","princeraj.14oct@gmail.com"]
- new_mentee = []
- mentee_emails.each{|mentee_email|
- u = User.find_by(:email => mentee_email)
- if u.present?
- next if Mentee.find_by(user_id: u.id).present?
- mentee = Mentee.new(:user_id => u.id)
- mentee.save!
- MenteeBatch.create(:batch_id => 1, :mentee_id => mentee.id)
- new_mentee << mentee
- end
- }
- # Double check content before sending mails
- new_mentee_user_id = Mentee.where("id > 327").pluck(:user_id)
- new_mentee_user_id.each{|user_id|
- NoLayoutMailer.send_adhoc_mailer(user_id, {subject: 'Select Your Mentor | InterviewBit Academy'}).deliver_now
- }
Add Comment
Please, Sign In to add comment