Permalink
Browse files

Choose between html and text body

  • Loading branch information...
1 parent 5958805 commit a583e759bace9045c0758bf3e291d18e91500c43 @r38y committed Apr 18, 2011
Showing with 6 additions and 1 deletion.
  1. +6 −1 app/models/post.rb
View
7 app/models/post.rb
@@ -10,7 +10,12 @@ def self.create_from_postmark(mitt)
post = user.posts.new
post.message_id = mitt.message_id
post.title = mitt.subject
- post.body = mitt.body
+ post.body = if mitt.text_body.blank?
+ mitt.html_body
+ else
+ mitt.text_body
+ end
+ # post.photo = mitt.attachments.first.read unless mitt.attachments.empty?
post.save
else
return false

0 comments on commit a583e75

Please sign in to comment.