如何从 URL 查看 Rails 电子邮件

发布于 2024-09-11 13:49:12 字数 431 浏览 1 评论 0原文

作为减轻编写 html 电子邮件痛苦的一小部分,我希望能够查看我正在制作的内容,而无需将其发送给自己。这也会在稍后出现“电子邮件未正确显示?在浏览器中查看!”的情况下有所帮助。关联。

我正在使用 Rails 3(到目前为止,ActionMailer 3.0 很令人高兴),并且有一个名为“Notifications”的电子邮件模型,其操作为“new_composition”。这发送正确,但目前相当难看。我想把它美化一下,但又不想给自己发 37 封电子邮件。

我希望 localhost:3000/notifications/new_composition 能带我到达那里,但没有路线与之匹配。而且我的 Rails 路由不够好,无法弄清楚(简单地添加 get "notification/new_composition" 显然是不对的,因为电子邮件模型不是控制器)。

丹卡。

As one tiny part of making authoring html emails less painful, I'd like to be able to view what I'm making without sending it to myself. This will also help later, with an "Email not displaying correctly? View it in your browser!" link.

I'm working with Rails 3 (thus far ActionMailer 3.0 is a delight) and have an email model called "Notifications" with an action "new_composition". This sends correctly, but is currently quite ugly. I'd like to pretty it up without sending myself 37 emails.

I would expect localhost:3000/notifications/new_composition to get me there, but no route matches that. And I'm not good enough with my rails routing fu to figure it out (simply adding get "notification/new_composition" obviously isn't right, since the email model isn't a controller).

Danka.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

与他有关 2024-09-18 13:49:12

我刚刚制作了一个名为NotificationsController 的控制器,它为邮件程序模型通常提供的值提供虚拟变量。它工作得很好,尽管对我来说似乎有点湿(即不干)。

I just made a controller called NotificationsController that supplies dummy variables for the values that the mailer model would usually supply. It works pretty well, though it seems a little wet (that is, not DRY) to me.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文