Rails action Mailer

module Namespace
    module UserDecorator
        def self.prepended(base)
          base.after_create :confirm_emails
          base.has_one_attached :identity_media, dependent: :destroy
          base.validates :identity_media, content_type: ['image/png', 'image/jpg', 'image/jpeg'], size: { less_than: 5.megabytes }
        end
      #ntcode
      def confirm_emails   
        Namespace::AccountMailer.new_account_email(self).deliver_now
      end
        
    end
  end
  ::Namespace::User.prepend(Spree::UserDecorator)

Notifier.welcome(User.first).deliver_later! # Notifier.welcome(User.first).deliver_later!(wait: 1.hour) # Notifier.welcome(User.first).deliver_later!(wait_until: 10.hours.from_now) # Notifier.welcome(User.first).deliver_later!(priority: 10) #

Leave a Comment

Your email address will not be published. Required fields are marked *