From: Tom Hughes Date: Thu, 1 Dec 2011 19:54:02 +0000 (+0000) Subject: Use either the HTML or the text part of an email, not both X-Git-Tag: live~5978 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/d88ada0d119e8ca1ca36fa9c69cb532e817087d1?hp=ce4a6eefa7405a3d23f722c987f0e22b966defc8 Use either the HTML or the text part of an email, not both --- diff --git a/script/deliver-message b/script/deliver-message index f28a9d9f3..7b5f60e01 100755 --- a/script/deliver-message +++ b/script/deliver-message @@ -19,11 +19,12 @@ end exit 0 unless recipient[3] == digest[0,6] mail = Mail.new(STDIN.readlines.join) +body = mail.html_part || mail.text_part message = Message.new(:sender => from, :recipient => to, :sent_on => mail.date.new_offset(0), :title => mail.subject.sub(/\[OpenStreetMap\] */, ""), - :body => mail.body.decoded) + :body => body.decoded) message.save! Notifier.message_notification(message).deliver