All threads / Attach image to summernote and send email
Ask A Question


You’re not receiving notifications from this thread.

Attach image to summernote and send email

Lee Terng Gio asked in Rails

I recently implement email in my rails app. I'm using summernote to create email templates and save it. Everything works fine. I can upload image to the editor and save it to database. But when I send the email template, the image in the email that I'd received is broken. I didn't use any uploader to handle the image uploaded, the image was encoded in Base64, so how do I fix this?

My mailer.rb
def message_send(candidate_mail)

@candidate_mail = candidate_mail


  to: "#{}",

  from: "#{@candidate_mail.from}",

  subject: "#{@candidate_mail.subject}",

  body: "#{@candidate_mail.body}",

  content_type:  "text/html",

  important: true,

  inline_css: true,



Join the discussion

Want to stay up-to-date with Ruby on Rails?

Join 69,840+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.

    logo Created with Sketch.

    Screencast tutorials to help you learn Ruby on Rails, Javascript, Hotwire, Turbo, Stimulus.js, PostgreSQL, MySQL, Ubuntu, and more. Icons by Icons8

    © 2023 GoRails, LLC. All rights reserved.