【发布时间】:2015-03-02 14:56:57
【问题描述】:
我在我的 Ruby On rails 应用程序中添加了邮戳。我按照页面 https://devcenter.heroku.com/articles/postmark#sending-emails-in-ruby-on-rails-3-x 中的步骤进行操作。现在我需要添加以下代码:
class SuperMailer < ActionMailer::Base
def email
from "test@domain.com"
subject "Hello"
recipients "myemail@domain.com"
tag "big-bang" end
end
但是,我不知道在哪里添加这个类,以及如何使用它。我是否将其添加到我的应用程序模块的 application.rb 文件中?
我如何使用这个类在提交后发送电子邮件(即当有人按下提交时)? 我在我的 static_pages 的 app > views 下的 html 文件中使用提交按钮编写了表单 我要执行以下操作吗?
<form name="contactform" method="post" > ...
【问题讨论】:
标签: html ruby-on-rails email heroku postmark