mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-30 21:27:17 +00:00
Create a reflex that handle re-send email confirmation to user
This commit is contained in:
13
app/reflexes/resend_confirmation_email_reflex.rb
Normal file
13
app/reflexes/resend_confirmation_email_reflex.rb
Normal 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
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user