Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

Commit

Permalink
after order email sent, mark order complete
Browse files Browse the repository at this point in the history
  • Loading branch information
louffoster committed May 25, 2022
1 parent 760516f commit e9efa15
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion app/admin/orders.rb
Original file line number Diff line number Diff line change
Expand Up @@ -297,9 +297,11 @@
end

member_action :send_order_email, :method => :put do
order = Order.find(params[:id])
resp = Job.submit("/orders/#{params[:id]}/email/send", nil)
if resp.success?
redirect_to "/admin/orders/#{params[:id]}", :notice => "Email sent to customer."
order.complete_order(current_user)
redirect_to "/admin/orders/#{params[:id]}", :notice => "Email sent to customer and order marked as complete."
else
redirect_to "/admin/orders/#{params[:id]}", :alert => "Unable to send email: #{resp.message}"
end
Expand Down
2 changes: 1 addition & 1 deletion config/environment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

# VERSION INFO
#
TRACKSYS_VERSION = '6.9.2'
TRACKSYS_VERSION = '6.9.3'

# Setup logger for all jobs processors
#
Expand Down

0 comments on commit e9efa15

Please sign in to comment.