我想要一个没有 Action Mailbox 或 Action Text 的新 Rails 6 应用程序,所以我创建了一个
rails new myapp --skip-action-mailbox --skip-action-text
然后我将它们删除application.rb
但当我运行时,bundle exec derailed bundle:mem它显示它们仍然存在:
rails/all: 36.2539 MiB
action_mailbox/engine: 13.5313 MiB
Run Code Online (Sandbox Code Playgroud)
如何删除它们以节省内存?
我正在尝试将电子邮件发送和接收服务从另一个邮件提供商迁移到 Amazon SES。Action Mailer 工作正常,但我尝试了一段时间,没有找到任何有关如何使用 SES 接收电子邮件的文档,除了一些博客文章声称 Action Mailbox 支持 SES:
它配备了 Amazon SES、Mailgun 的入口......
只有 Mailgun 和 Sendgrid 以及其他几个官方指南上的文档,但没有 SES。我有什么想法应该从哪里开始吗?
Rails 6 现在带有 Action Mailbox。文档和社区没有关于如何集成除最常见的服务(如 SendGrid)之外的各种服务的大量资源。
假设一个人使用 Google 的 Gsuite Gmail:
他们如何将其与 Action Mailbox 集成?
会使用 Gmail 的 API,还是不适合 Action Mailbox?
如果 Gmail 不起作用,那么 SendGrid 有什么不同使它能够适当地集成?
目前,我们允许用户互相发送电子邮件,而无需看到彼此的实际电子邮件地址(双盲),方法是让他们将电子邮件发送到username@parse.example.com效果很好的地址。
class ForwardsMailbox < ApplicationMailbox
before_processing :ensure_users
def process
content = mail.multipart? ? mail.parts.first.body.decoded : mail.decoded
UserMailer.with(sender: sender, recipient: recipient, subject: mail.subject, content: content).forward_email.deliver_later
end
private
def sender
@sender ||= User.find_by(email: mail.from.first)
end
def recipient
@recipient ||= User.find_by(username: mail.to.first.split('@').first)
end
def ensure_users
bounce_with UserMailer.invalid_user(inbound_email) if sender.nil? or recipient.nil?
end
end
Run Code Online (Sandbox Code Playgroud)
是否可以转发整个mail对象而不是提取其内容、检查它是否是多部分等?