Here after called the controller.rb, one file(chart.png) will save in my rails app folder, so how to take this and will attach with mail?
controller.rb
def mail
@imageURL = "https://chart.googleapis.com/chart?chs=150x150&cht=qr&chl=5&choe=UTF-8"
open(@imageURL) do |chart|
File.open('chart.png', 'wb') {|f| f.write chart.read }
end
UserMailer.welcome_email(@imageURL, @mailID).deliver
end
how can i pass that image into welcome_email method for attaching with the mail? need some help to solve this?
user_mailer.rb
def welcome_email(imageURL, mailID)
mail(:to => mailID,
:subject => "code",
:body => "Code for the branch "+imageURL+"")
end
end