私は自分のウェブサイトの連絡フォームでレール上で作業しています。私は電子メールを送信し、件名が記載された電子メールを受信しました。しかし、本体は空白です。ここにコードがあります:
contact_mailer.rb
class ContactMailer < ActionMailer::Base
default from: "noreplay@hybrid-tech.net"
default to: "info@hybrid-tech.net"
def new_message(contact_message)
@contact_message = contact_message
mail(subject: "Send it from Hybrid Tech Website - #{@contact_message.subject} ")
end
end
景色
contact_email.html.erb
<!DOCTYPE html>
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
</head>
<body>
<h1>Name: <%= @contact_message.name %></h1>
<h1>E-Mail: <%= @contact_message.email %></h1>
<p>
Message: <%= @contact_message.body %><br/>
</p>
</body>
</html>
誰かがここで何が問題なのかを知っていて、考えていますか?
ありがとう!!!