Ruby on rails 重用操作邮件器模板
如何对多个邮件“操作”重用相同的操作邮件模板 在ActionController中,您可以Ruby on rails 重用操作邮件器模板,ruby-on-rails,actionmailer,Ruby On Rails,Actionmailer,如何对多个邮件“操作”重用相同的操作邮件模板 在ActionController中,您可以 ... render :action => 'another_action' 我想象同样的事情可以在ActionMailer中完成,但我似乎找不到正确的方法。如果相关的话,我会使用Rails 2.3.2 谢谢 您正在查找render_消息,下面粘贴的部分中有一个很好的示例 class ApplicationMailer < ActionMailer::Base def signup_no
...
render :action => 'another_action'
我想象同样的事情可以在ActionMailer中完成,但我似乎找不到正确的方法。如果相关的话,我会使用Rails 2.3.2
谢谢 您正在查找render_消息,下面粘贴的部分中有一个很好的示例
class ApplicationMailer < ActionMailer::Base
def signup_notification(recipient)
recipients recipient.email_address_with_name
subject "New account information"
from "system@example.com"
content_type "multipart/alternative"
part :content_type => "text/html",
:body => render_message("signup-as-html", :account => recipient)
part "text/plain" do |p|
p.body = render_message("signup-as-plain", :account => recipient)
p.transfer_encoding = "base64"
end
end
end
class ApplicationMailer“文本/html”,
:body=>render_消息(“注册为html”,:account=>recipient)
部分“文本/普通”do | p|
p、 body=render_消息(“以普通方式注册”,:account=>recipient)
p、 传输编码=“base64”
结束
结束
结束
您正在查找render_消息,下面粘贴的部分中有一个很好的示例
class ApplicationMailer < ActionMailer::Base
def signup_notification(recipient)
recipients recipient.email_address_with_name
subject "New account information"
from "system@example.com"
content_type "multipart/alternative"
part :content_type => "text/html",
:body => render_message("signup-as-html", :account => recipient)
part "text/plain" do |p|
p.body = render_message("signup-as-plain", :account => recipient)
p.transfer_encoding = "base64"
end
end
end
class ApplicationMailer“文本/html”,
:body=>render_消息(“注册为html”,:account=>recipient)
部分“文本/普通”do | p|
p、 body=render_消息(“以普通方式注册”,:account=>recipient)
p、 传输编码=“base64”
结束
结束
结束
该示例已从该页面中删除!此外,未提及render_message
,它似乎从v2.3.8起已被删除/cc@mikethe示例已从该页面中删除!此外,未提及render_message
,它似乎从v2.3.8起已被删除/抄送@mike