Edit store email views

I cannot find the tag shoppe

on stackoverflow.


I am using Shoppe gem for rails.

I want to know if there is a way to edit the views for the email messages that are sent when an order is placed in the store.

I want to add an attachment to my email when you accept an order.

Thank!

+3


source to share


2 answers


It seems that you can simply override the Shoppe mailer method:

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

      



Puts this somewhere in your app/initializers

. Don't forget to set your content correctly.

+2


source


This is the best and quickest solution for anyone who just wants to change the actual text like me.

You can just go directly to the email file and edit it. all I did was visit the Exact File Here and recreate that file and its path in my own application and change the words to my liking.



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

+1


source







All Articles