Create a reflex that handle re-send email confirmation to user

This commit is contained in:
Jean-Baptiste Bellet
2022-10-17 16:40:01 +02:00
parent 9997fe26fc
commit bcc9d447e1
2 changed files with 17 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
# frozen_string_literal: true
class ResendConfirmationEmailReflex < ApplicationReflex
def confirm(order_ids)
Spree::Order.where(id: order_ids).find_each do |o|
Spree::OrderMailer.confirm_email_for_customer(o.id, true).deliver_later
end
flash[:success] = I18n.t("admin.resend_confirmation_emails_feedback", count: order_ids.count)
cable_ready.dispatch_event(name: "modal:close")
morph "#flashes", render(partial: "shared/flashes", locals: { flashes: flash })
end
end

View File

@@ -1566,6 +1566,10 @@ en:
stripe_connect_settings:
resource: Stripe Connect configuration
resend_confirmation_emails_feedback:
one: "Confirmation email sent for 1 order."
other: "Confirmation emails sent for %{count} orders."
# API
#
api: