anchor.diff:      -d '{ "accountId": "<account_id>", "pluginName": "__EXTERNAL_PAYMENT__"}' \
       "http://127.0.0.1:8080/1.0/kb/accounts/<account_id>/paymentMethods" 
       
  -. If successful, the command above returns a `Location` header like \
  -\http://127.0.0.1:8080/1.0/kb/paymentMethods/c2ff0040-7c5b-48bf-9685-a4c57501535f. Copy the payment method id in the header (`c2ff0040-7c5b-48bf-9685-a4c57501535f` in this case) and save it for future use.
  +. If successful, the command above returns a `Location` header like 
  +\http://127.0.0.1:8080/1.0/kb/paymentMethods/c2ff0040-7c5b-48bf-9685-a4c57501535f. Copy the `payment_method_id` in the header (`c2ff0040-7c5b-48bf-9685-a4c57501535f` in this case) and save it for future use.
   
   . Set the payment method as default as follows (replace `<account_id>` and `<payment_method_id>` with the values obtained above):
   [source,bash]
  
positive.code: 
  [options="header",cols="1,1"]
  |===
  |Event Type   |Event Description
  //-------------
  |INVOICE_CREATION   |The customer will receive an email informing that a new invoice is available.   
  |INVOICE_NOTIFICATION   |The customer will receive an email about upcoming invoices (the time at which to send the email is configured through the Kill Bill system property `org.killbill.invoice.dryRunNotificationSchedule`)   
  |INVOICE_PAYMENT_SUCCESS   |The customer will receive an email after each successful payment or refund   
  |INVOICE_PAYMENT_FAILED   |The customer will receive an email after each failed payment   
  |SUBSCRIPTION_CANCEL   | The customer will receive an email at the time a subscription was requested to be cancelled and/or at the effective date of the subscription cancellation   
  |===
  
  In order to send an email the following is required:
  
  * The tenant or account must be configured to permit such event(s). This is explained in the <<Plugin Configuration>> section below.
  
  * The account for which the emails need to be sent must have certain fields like `locale`, `email`, `company`, `address1`, `city`, `state`, `postalCode`, `country` set. This is explained in the <<Testing the plugin>> section below.
  
  
  
  
negative.code: 
  A plugin can be installed via the https://github.com/killbill/killbill-cloud/blob/master/kpm[Kill Bill Package Manager (KPM)]. For this, please follow the steps given below:
  
  . Ensure that you have kpm installed as explained https://github.com/killbill/killbill-cloud/tree/master/kpm#kpm-installation[here]. 
  
  . Install the plugin using the following kpm command (Replace `<path_to_install_plugin>` with the path where you want to install the plugin. This path should match the path specified by the `org.killbill.osgi.bundle.install.dir` property in the Kill Bill configuration file):
  [source,bash]
  kpm install_java_plugin email-notifications --destination=<path_to_install_plugin>
  
  . Verify that the plugin is installed properly. This can be done by ensuring that the plugin JAR is present at the `path_to_install_plugin` specified in the previous step. Alternatively, you can also open `kpm` in https://docs.killbill.io/latest/userguide_kaui.html[Kaui] and verify that the email notification plugin is running as follows:
  image:https://github.com/killbill/killbill-docs/raw/v3/userguide/assets/img/email-notification-plugin/kaui_email_notification_plugin.png[align=center]
  
  . If you would like to make changes to the plugin, you can clone the plugin code, build and deploy it as explained https://github.com/killbill/killbill-email-notifications-plugin[here]. 
  
  
  == Database Configuration
  
  The email-notification-plugin requires some additional database tables. To create these tables, please follow the steps given below:
  
  * Connect to the Kill Bill database. 
  
  