~singpolyma/sgx-jmp

ff4d42fc125a7731e972466d2d3a2e40a18dad91 — Stephen Paul Weber 1 year, 7 months ago a5300d6
notify_customer helper
1 files changed, 7 insertions(+), 3 deletions(-)

M lib/admin_command.rb
M lib/admin_command.rb => lib/admin_command.rb +7 -3
@@ 75,11 75,15 @@ class AdminCommand
		BillPlanCommand.for(@target_customer).call
	end

	def action_cancel_account
	def notify_customer(body)
		m = Blather::Stanza::Message.new
		m.from = CONFIG[:notify_from]
		m.body = "Your JMP account has been cancelled."
		@target_customer.stanza_to(m).then {
		m.body = body
		@target_customer.stanza_to(m)
	end

	def action_cancel_account
		notify_customer("Your JMP account has been cancelled.").then {
			EMPromise.all([
				@target_customer.stanza_to(IBR.new(:set).tap(&:remove!)),
				@target_customer.deregister!,