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