gpt4 book ai didi

ruby-on-rails - 在 shopee 中编辑电子邮件 View

转载 作者:行者123 更新时间:2023-12-04 06:14:31 27 4
gpt4 key购买 nike

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


我正在使用 Shoppe rails 的 gem 。

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

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

谢谢!

最佳答案

看来你可以重新定义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 中。请记住正确设置您的内容类型。

关于ruby-on-rails - 在 shopee 中编辑电子邮件 View ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31886272/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com