From ff4d42fc125a7731e972466d2d3a2e40a18dad91 Mon Sep 17 00:00:00 2001 From: Stephen Paul Weber Date: Wed, 13 Jul 2022 09:35:40 -0500 Subject: [PATCH] notify_customer helper --- lib/admin_command.rb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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!,