3

I'm trying to get plain simple text (no HTML) from email.

It works when I send email with plain text such as "hey this works fine"

It doesn't work when I include an emoji in the email body and it gives the error below in logs.

ActionMailbox::RoutingJob (Job ID: c9ca878b-) from Async(default) in 32.86ms: 
NoMethodError (Can not decode an entire message, try calling #decoded on the various fields and body or parts if it is a multipart message.):

My code is very simple:

I'm using mail.decoded is there any other function I can use with decoded to strip any unwanted character maybe

def process
        category.posts.create(user: user, cat_id: @cat.id, body: mail.decoded)
      end
jonrsharpe
  • 115,751
  • 26
  • 228
  • 437
Designer
  • 1,061
  • 1
  • 12
  • 26

0 Answers0