SENDING EMAIL NOTIFICATIONS

42 views
Skip to first unread message

Zachary Ndung'u

unread,
Jun 10, 2025, 8:03:19 AM6/10/25
to Kill Bill users mailing-list
Hello team, I am using /1.0/kb/invoices/charges/{accountId}
Create external charge(s)    to generate an invoice which is great. On my docker -compose.yml i have done a configuration for mailtrap to send email. 
below is my docker set up. Once an invoice is generated the system does not call the INVOICE_CREATION  for notification 
version: "3.7"

services:
killbill:
image: killbill/killbill:0.24.10
container_name: killbill
ports:
- "8082:8080"
extra_hosts:
- "host.docker.internal:host-gateway"
environment:
# Database Configuration
KILLBILL_DAO_URL: "jdbc:mysql://host.docker.internal:3306/killbill?useSSL=false&allowPublicKeyRetrieval=true"
KILLBILL_DAO_USER: "killbill"
KILLBILL_DAO_PASSWORD: "StrongPasswordHere"
# Tell Kill Bill to install and load the 'email-notifications' plugin # <-- ADDED
KILLBILL_PLUGINS_INSTALL: 'email-notifications'
# MailTrap SMTP Configuration
KILLBILL_EMAIL_SMTP_HOST: "sandbox.smtp.mailtrap.io"
KILLBILL_EMAIL_SMTP_PORT: "587"
KILLBILL_EMAIL_SMTP_USER: "210d8c0a9f8a8a" # Replace with your MailTrap username
KILLBILL_EMAIL_SMTP_PASSWORD: "a4898475465b33" # Replace with your MailTrap password
KILLBILL_EMAIL_SMTP_USEAUTHENTICATION: "true"
KILLBILL_EMAIL_SMTP_USESSL: "false"
KILLBILL_EMAIL_SMTP_USETLS: "true"
# Email Sender Configuration
KILLBILL_EMAIL_FROM: "in...@johndoe.com" # Replace with your verified sender email
KILLBILL_EMAIL_FROMNAME: "John Joe"
# Additional Email Settings
KILLBILL_EMAIL_SMTP_CONNECTIONTIMEOUT: "60000"
KILLBILL_EMAIL_SMTP_TIMEOUT: "60000"
# Enable email notifications plugin globally
KILLBILL_EMAIL_NOTIFICATIONS_ENABLED: "true"
# Invoice Notification Settings for Invoice Creation
KILLBILL_INVOICE_EMAIL_NOTIFICATIONS_ENABLED: "true"
KILLBILL_INVOICE_EMAIL_NOTIFICATIONS_SEND_ON_CREATION: "true"
# Payment Notification Settings for Payment Success
# Note: The plugin sends a single "Payment Success" email which includes invoice details if applicable.
KILLBILL_PAYMENT_EMAIL_NOTIFICATIONS_SEND_ON_SUCCESS: "true"
# You can also enable these if needed
# KILLBILL_INVOICE_EMAIL_NOTIFICATIONS_SEND_ON_PAYMENT_SUCCESS: "false" # This is often redundant with the one below
# KILLBILL_PAYMENT_EMAIL_NOTIFICATIONS_SEND_ON_FAILURE: "true"

volumes:
- killbill_plugins:/var/lib/killbill/bundles
depends_on:
- plugin_installer

kaui:
image: killbill/kaui:3.0.9
container_name: kaui
ports:
- "9090:8080"
extra_hosts:
- "host.docker.internal:host-gateway"
environment:
KAUI_CONFIG_DAO_URL: "jdbc:mysql://host.docker.internal:3306/kaui?useSSL=false&allowPublicKeyRetrieval=true"
KAUI_CONFIG_DAO_USER: "killbill"
KAUI_CONFIG_DAO_PASSWORD: "StrongPasswordHere"
KAUI_KILLBILL_URL: "http://killbill:8080"
restart: unless-stopped

plugin_installer:
image: curlimages/curl:latest
container_name: plugin_installer
volumes:
- killbill_plugins:/plugins
command: >
sh -c "
set -e
cd /plugins
# Using version 2.1.2, which is compatible with Kill Bill 0.24.10 # <-- CORRECTED
tar -xzf email-notifications.tar.gz
rm email-notifications.tar.gz
echo 'Email notifications plugin v2.1.2 downloaded successfully'
"

volumes:
killbill_plugins: HERE ARE THE LOGS killbill          | {"@timestamp":"2025-06-10T10:49:49.589Z","message":"Enabling session validation scheduler...","logger_name":"org.apache.shiro.session.mgt.AbstractValidatingSessionManager","thread_name":"catalina-exec-1","level":"INFO"}
killbill          | {"@timestamp":"2025-06-10T10:49:49.944Z","message":"1 * Server has received a request on thread catalina-exec-1\n1 > POST http://localhost:8082/1.0/kb/invoices/charges/c9441314-3c71-43ff-b65e-4b9b4d0418ab?autoCommit=false\n1 > accept: application/json\n1 > accept-encoding: gzip\n1 > authorization: **********\n1 > content-length: 85\n1 > content-type: application/json\n1 > host: localhost:8082\n1 > user-agent: ReactorNetty/1.2.1\n1 > x-killbill-apikey: YjNmYzBmM2UtN2M2OS00NTM0LWI1ZjYtYzVmMGU0MzAzMzdk\n1 > x-killbill-apisecret: ************************************************\n1 > x-killbill-createdby: admin\n","logger_name":"org.glassfish.jersey.logging.LoggingFeature","thread_name":"catalina-exec-1","level":"INFO","req.requestURI":"/1.0/kb/invoices/charges/c9441314-3c71-43ff-b65e-4b9b4d0418ab","req.queryString":"autoCommit=false","kb.tenantRecordId":"19","req.method":"POST","req.remoteHost":"172.18.0.1","req.requestURL":"http://localhost:8082/1.0/kb/invoices/charges/c9441314-3c71-43ff-b65e-4b9b4d0418ab","req.userAgent":"ReactorNetty/1.2.1"}
killbill          | {"@timestamp":"2025-06-10T10:49:50.641Z","message":"1 * Server responded with a response on thread catalina-exec-1\n1 < 200\n1 < Content-Type: application/json\n","logger_name":"org.glassfish.jersey.logging.LoggingFeature","thread_name":"catalina-exec-1","level":"INFO","req.requestURI":"/1.0/kb/invoices/charges/c9441314-3c71-43ff-b65e-4b9b4d0418ab","req.queryString":"autoCommit=false","kb.tenantRecordId":"19","kb.userToken":"7f7d24cd-5149-4ade-a9cb-00fa168ebe52","req.method":"POST","kb.accountRecordId":"38","req.remoteHost":"172.18.0.1","req.requestURL":"http://localhost:8082/1.0/kb/invoices/charges/c9441314-3c71-43ff-b65e-4b9b4d0418ab","req.userAgent":"ReactorNetty/1.2.1"}
killbill          | {"@timestamp":"2025-06-10T10:49:50.822Z","message":"2 * Server has received a request on thread catalina-exec-2\n2 > GET http://localhost:8082/1.0/kb/invoices/539c4d30-7262-45cf-805b-b7bca2a2bd58\n2 > accept: application/json\n2 > accept-encoding: gzip\n2 > authorization: **********\n2 > content-length: 0\n2 > content-type: application/json\n2 > host: localhost:8082\n2 > user-agent: ReactorNetty/1.2.1\n2 > x-killbill-apikey: YjNmYzBmM2UtN2M2OS00NTM0LWI1ZjYtYzVmMGU0MzAzMzdk\n2 > x-killbill-apisecret: ************************************************\n2 > x-killbill-createdby: admin\n","logger_name":"org.glassfish.jersey.logging.LoggingFeature","thread_name":"catalina-exec-2","level":"INFO","req.requestURI":"/1.0/kb/invoices/539c4d30-7262-45cf-805b-b7bca2a2bd58","kb.tenantRecordId":"19","req.method":"GET","req.remoteHost":"172.18.0.1","req.requestURL":"http://localhost:8082/1.0/kb/invoices/539c4d30-7262-45cf-805b-b7bca2a2bd58","req.userAgent":"ReactorNetty/1.2.1"}

Reshma Bidikar

unread,
Jun 11, 2025, 7:18:58 AM6/11/25
to Kill Bill users mailing-list
Hello,

The latest version of the email notifications plugin is 0.8.1 and can be downloaded from https://central.sonatype.com/artifact/org.kill-bill.billing.plugin.java/killbill-email-notifications-plugin/versions.

Your Docker file seems to refer to version 2.1.2, I'm not quite sure which version this is. 

Hope this helps!

Regards,
Reshma

Message has been deleted

Zachary Ndung'u

unread,
Jun 18, 2025, 11:06:56 AM6/18/25
to Kill Bill users mailing-list
Hello, 
Thanks for the clarification. I am trying to use 1 SMTP for all my tenants using docker-compose.yml set up. Is it possible?
Regards,
Zack
Reply all
Reply to author
Forward
0 new messages