To process email
# File app/models/email_processor.rb, line 3 def self.process(email) begin puts email.subject puts email.from puts email.to puts email.body puts email.subject.include? "Re: New comment from - " puts email.to == "support@GuideU.co" puts User.find_by(email: email.from) if email.subject.include? "Re: New comment from - " puts "entered" email.subject["Re: New comment from - "] = "" puts email.subject @commentor = User.find_by(email: email.from) @for_user = User.find_by(email: email.subject) @comment = @commentor.comments_posted.new text: email.body @comment.for_user = @for_user @comment.set_tutor_flag @comment.save! puts @comment puts "done" end rescue => e true end end