Change summary
lib/admin_command.rb | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
Detailed changes
@@ -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!,