如何在 Rails 3 中从 ActionMailer 发送签名电子邮件?
使用 Rails 3 我想使用 X.509 证书来签署部分电子邮件。目前有一个针对 Rails 2 的答案 How do I sendsigned emails来自 ActionMailer? 但它在 Rails 3 上不起作用。
是否可以在 Rails 3 中通过 ActionMailer 签署电子邮件? 如果不可能,是否可以在 ActionMailer 创建后通过 sendmail 签署电子邮件?
Using Rails 3 I want to use an X.509 certificate to sign parts of emails. There is a currently existing answer for Rails 2 at How do I send signed emails from ActionMailer? but it doesn't work on Rails 3.
Is it possible to sign emails via ActionMailer in Rails 3?
If that is not possible, is it possible to sign emails via sendmail after creating by ActionMailer?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
也许这不是最好的答案,但这就是我要做的:
尝试安装该插件(即使它适用于 Rails 2.0.x)
测试并修复代码直到得到结果
查看代码,结果发现核心文件是:
https://github.com/penso/actionmailer_x509/blob/master/lib/actionmailer_x509 .rb
公开了邮件程序 DSL 的一堆方法:
这样您就可以获取该文件,并将其放在 $APP/lib 下,然后编写一些测试来检查它是否正常工作。
一个。
perhaps it's not the best answer, however here's what I'd do:
try to install that plugin (even if it's for rails 2.0.x)
tests and fix code until I get the result
looking at the code, turns out that the core file is:
https://github.com/penso/actionmailer_x509/blob/master/lib/actionmailer_x509.rb
which exposes a bunch of methods for mailer DSL:
so you could grab that file, and put it under $APP/lib, then write some test to check it's working.
A.
我已经将actionmailer_x509移植到Rails 3并将其包装到gem中。所以现在它可以在这里使用:https://github.com/petRUShka/actionmailer_x509
I have been ported actionmailer_x509 to Rails 3 and wrap it into the gem. So now it works and available here: https://github.com/petRUShka/actionmailer_x509