anchor.diff:              lager:debug("failed to publish_customer update notification: ~p", [_E])
       end.
   
  --spec build_customer_update_payload(cb_context:context()) -> kz_proplist().
  -build_customer_update_payload(AccountId) ->
  -  {'ok', AccountDoc} = kz_account:fetch(AccountId),
  +-spec build_customer_update_payload(ne_binary(), ne_binary(), kz_json:object()) -> kz_proplist().
  +build_customer_update_payload(AccountId, TemplateId, DataBag) ->
       props:filter_empty(
         [{<<"Account-ID">>, kz_services:find_reseller_id(AccountId)}
      %   ,{<<"Recipient-ID">>, AccountId}
         ,{<<"Recipient-ID">>, <<"9dab2e56e27b4d1ce381ca9aaa8b0303">>}
  -      ,{<<"Template-ID">>, <<"customer_update_billing_period">>}
  -      ,{<<"DataBag">>, {[{<<"field1">>,<<"value1">>},{<<"field2">>,{[{<<"subfield1">>,kz_account:name(AccountDoc)},{<<"subfield2">>,<<"subvalue2">>}]}}]}}
  -      ,{<<"HTML">>, base64:encode(<<"Dear {{user.first_name}} {{user.last_name}}. <br /><br />DataBag test: {{databag.field2.subfield1}} <br /><br /> Kind regards,">>)}
  -      ,{<<"Text">>, <<"Oh Dear {{user.first_name}} {{user.last_name}}.\n\nDataBag test: {{databag.field2.subfield2}}\n\nBest regards,">>}
  +      ,{<<"Template-ID">>, TemplateId}
  +      ,{<<"DataBag">>, DataBag}
          | kz_api:default_headers(?APP_NAME, ?APP_VERSION)
         ]).
   
   -spec maybe_send_account_updates(ne_binary(), kz_account:doc()) -> 'ok'.
   maybe_send_account_updates(AccountId, AccountJObj) ->
       case onbill_util:maybe_allow_postpay(AccountId) of
  -        'true' -> 'ok';
           'false' ->
  -            maybe_new_billing_period_approaching(AccountId, AccountJObj)
  +            maybe_new_billing_period_approaching(AccountId, AccountJObj);
  +        _ -> 'ok'
       end.
   
   -spec maybe_new_billing_period_approaching(ne_binary(), kz_account:doc()) -> 'ok'.
  
positive.code:             Diff = kz_time:current_tstamp() - MRC_ApproachingSent,
              case Diff >= Cycle of
                 'true' ->
                      'ok' = send_account_update(AccountId),
                      update_account_mrc_approaching_sent(AccountJObj);
                 'false' ->
                     lager:debug("mrc approaching alert sent ~w seconds ago, repeats every ~w", [Diff, Cycle])
              end;
          _Else ->
              'ok' = send_account_update(AccountId),
              update_account_mrc_approaching_sent(AccountJObj)
      end,
      'ok';
  maybe_send_new_billing_period_approaching_update(AccountId, _AccountJObj, 'false') ->
      lager:debug("mrc approaching alert disabled for Account: ~p", [AccountId]).
  
  -spec update_account_mrc_approaching_sent(kz_account:doc()) -> 'ok'.
  update_account_mrc_approaching_sent(AccountJObj0) ->
  
negative.code:         kapps_config:get_integer(?MOD_CONFIG_CRAWLER, <<"mrc_approaching_repeat_s">>, 1 * ?SECONDS_IN_DAY)).
  
  
  -spec send_account_update(ne_binary(), ne_binary(), kz_json:object()) -> 'ok'.
  send_account_update(AccountId, TemplateId, DataBag) ->
      lager:info("IAM send_account_update AccountId: ~p",[AccountId]),
      lager:info("IAM send_account_update TemplateId: ~p",[TemplateId]),
      lager:info("IAM send_account_update DataBag: ~p",[DataBag]),
      lager:info("IAM send_account_update Payload: ~p",[build_customer_update_payload(AccountId, TemplateId, DataBag)]),
      case kz_amqp_worker:call(build_customer_update_payload(AccountId, TemplateId, DataBag)
                              ,fun kapi_notifications:publish_customer_update/1
                              ,fun kapi_notifications:customer_update_v/1
                              )
  