diff --git a/lib/admin_command.rb b/lib/admin_command.rb index f19eb4ad2947a1604f88f7c71ba3211b58c8b6a4..627c5bb9231460dce898512ae77813651e8e85d7 100644 --- a/lib/admin_command.rb +++ b/lib/admin_command.rb @@ -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!,