Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/179.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 重用操作邮件器模板_Ruby On Rails_Actionmailer - Fatal编程技术网

Ruby on rails 重用操作邮件器模板

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

如何对多个邮件“操作”重用相同的操作邮件模板

在ActionController中,您可以

...
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