How to extract plain text differs depending on whether Gmail received by ActionMailbox is a simplified version or not. Perhaps other mailers fall into either category. .. .. .. Should be.
How to extract each plain text. Gmail simplified version-> mail.body.decoded Gmail current version-> mail.text_part.body.decoded
plain_text extraction example
def plain_text
mail.text_part.nil? ? mail.body.decoded : mail.text_part.body.decoded
end
At first I was impatient because I thought it was necessary for gem'sanitize'. Although it was a knowledge within the range of common sense, I stumbled unexpectedly.
Recommended Posts