在 shopee 中编辑电子邮件视图

Edit email views in shoppe

我似乎无法在 Whosebug 中找到 shoppe 标签。


我正在使用 Shoppe gem 作为 rails。

我想知道是否有办法编辑在专柜下订单时发送的电子邮件的视图。

我想在您接受订单时在电子邮件中添加一个附件。

谢谢!

看来你可以重新定义Shoppe的mailer方法:

module Shoppe
  class OrderMailer < ActionMailer::Base

    def received(order)
      @order = order
      attachment(content_type: 'image/jpeg', body: File.read('image.jpg'))
      mail :from => Shoppe.settings.outbound_email_address, :to => order.email_address, :subject => I18n.t('shoppe.order_mailer.received.subject', :default => "Order Confirmation")
    end
  end
end

将其放入您的 app/initializers 的某处。请记住正确设置您的内容类型。

对于那些只想像我一样更改实际文本的人来说,这是最好和最快的解决方案。

您可以直接转到电子邮件的文件并进行编辑。我所做的只是访问 The exact File Here 并将该文件及其路径重新创建到我自己的应用程序中,然后根据我的喜好更改文字。

https://github.com/tryshoppe/shoppe/blob/master/app/views/shoppe/order_mailer/accepted.text.erb