Class: CopayNotifications::NewStatementNotificationJob

Inherits:
Object
  • Object
show all
Includes:
SentryLogging, Sidekiq::Job
Defined in:
app/sidekiq/copay_notifications/new_statement_notification_job.rb

Constant Summary collapse

MCP_NOTIFICATION_TEMPLATE =
Settings.vanotify.services.dmc.template_id.vha_new_copay_statement_email
STATSD_KEY_PREFIX =
'api.copay_notifications.new_statement'

Instance Method Summary collapse

Methods included from SentryLogging

#log_exception_to_sentry, #log_message_to_sentry, #non_nil_hash?, #normalize_level, #rails_logger, #set_sentry_metadata

Instance Method Details

#perform(statement) ⇒ Object



41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'app/sidekiq/copay_notifications/new_statement_notification_job.rb', line 41

def perform(statement)
  # rubocop:disable Lint/UselessAssignment
  StatsD.increment("#{STATSD_KEY_PREFIX}.total")
  statement_service = DebtManagementCenter::StatementIdentifierService.new(statement)
  user_data = statement_service.get_mpi_data
  icn = user_data[:icn]
  personalization = {
    'name' => user_data[:first_name],
    'date' => Time.zone.today.strftime('%B %d, %Y')
  }
  statement_date = statement['statementDate']
   = statement['accountBalance']
  Rails.logger.info("Notification Data: date-#{statement_date}, balance-#{}")
  # rubocop:enable Lint/UselessAssignment
  # pausing until further notice
  # DebtManagementCenter::VANotifyEmailJob.perform_async(icn, MCP_NOTIFICATION_TEMPLATE, personalization, 'icn')
end