生成 Rails 应用程序中所有电子邮件的示例版本
为 Rails 应用程序生成的每封电子邮件生成示例/测试版本的最佳方法是什么(例如,以便其他人可以查看它们以进行内容更改)?如果默认情况下没有简单的方法,是否有任何宝石或简单的代码更改可以促进将来执行此操作?
What is the best way to generate a sample/test version of every email that can be produced by a Rails application (for example, so that someone else can look them over to make content changes)? If there isn't an easy way by default, are there any gems or easy code changes that would facilitate doing this in the future?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
没有简单的方法或宝石可以做到这一点。原因是电子邮件可以通过多种不同的方式实现。我的建议是将电子邮件模板文件保存在单独的位置 - 以便轻松检索它们并将其发送给某人,或者使用外部 API 发送电子邮件,例如 MadMimi,允许您将电子邮件模板保存在单独的网站上。
There isn't an easy way or a gem that does this. The reason is that emails can be implemented in a variety of different ways. My recommendation would be to either keep your email template files in a separate location - so that they are easy to retrieve and send to someone, or to use an external API for sending your emails, such as MadMimi, that allows you to keep your email templates on a separate website.