All threads / Attach image to summernote and send email

Ask A Question

Notifications

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

mail(

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

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

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

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

  content_type:  "text/html",

  important: true,

  inline_css: true,


  )

end

Join the discussion

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

Join 35,095+ 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.

    Ruby on Rails tutorials, guides, and screencasts for web developers learning Ruby, Rails, Javascript, Turbolinks, Stimulus.js, Vue.js, and more. Icons by Icons8

    © 2020 GoRails, LLC. All rights reserved.