Skip to content

Commit

Permalink
Merge pull request #566 from reshmabidikar/v3
Browse files Browse the repository at this point in the history
Email notification doc/configuration doc corrections
  • Loading branch information
reshmabidikar authored Sep 27, 2024
2 parents 68246e5 + 6c6c4b1 commit 458c066
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ KB_org_killbill_notificationq_${instanceName}_shutdownTimeout |Shutdown sequen
//-------------------------------------------------
|org.killbill.billing.server.event.post.type.skip/
KB_org_killbill_billing_server_event_post_type_skip |List of event types to be skipped (not posted) |- |Config File/Environment Variable
KB_org_killbill_billing_server_event_post_type_skip |List of event types to be skipped (not posted) |- |Per-Tenant/Config File/Environment Variable
|org.killbill.billing.server.event.dispatch.type.skip/
KB_org_killbill_billing_server_event_dispatch_type_skip |List of event types to be skipped (not dispatched internally) |- |Per-Tenant/Config File/Environment Variable
Expand Down
28 changes: 14 additions & 14 deletions userguide/tutorials/email-notification-plugin.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -279,11 +279,11 @@ The email notification plugin uses *one template per locale and per type* (as op
=== Resources Overview
In addition to templates, the email notification plugin requires a resource file. This resource file contains *key-value pairs* which can be used to replace variables in a template. The email notification plugin comes with a https://github.com/killbill/killbill-email-notifications-plugin/tree/6fc76403233fd5be290841ee6fc9d728028892f0/src/main/resources/org/killbill/billing/plugin/notification/translations[default resource file] that contains key-value pairs for the variables in the default templates.
In addition to templates, the email notification plugin requires a resource file. This resource file contains *key-value pairs* which can be used to replace variables in a template. The email notification plugin comes with a https://github.com/killbill/killbill-email-notifications-plugin/tree/master/src/main/resources/org/killbill/billing/plugin/notification/translations[default resource file] that contains key-value pairs for the variables in the default templates.
Unlike email templates, all the events have a single resource file. However, different locales can have different resource files. This allows having string translations in different languages, (like different translations for the catalog product names). So for example, you can have different resource files like `Translation_en_US.properties`, `Translation_fr_FR.properties`, and so on. When an email needs to be sent for a user, the user's `locale` is checked and the corresponding resource file is used to replace the variables in the template.
The https://github.com/killbill/killbill-email-notifications-plugin/blob/6fc76403233fd5be290841ee6fc9d728028892f0/src/main/resources/org/killbill/billing/plugin/notification/translations/Translation_en_US.properties[default resource file] is available only for the *en_US* locale. Users can add additional key-value pairs to this resource file as well as add new resource files for different locales.
The https://github.com/killbill/killbill-email-notifications-plugin/tree/master/src/main/resources/org/killbill/billing/plugin/notification/translations/Translation_en.properties[default resource file] is available only for the *en_US* locale. Users can add additional key-value pairs to this resource file as well as add new resource files for different locales.
=== Template/Translation Resource Keys
Expand All @@ -295,13 +295,13 @@ The following table provides details about the template/translation resource key
|===
|Template Type |Template Key|Template Description| Default Template
//----------------------
|Invoice creation |killbill-email-notifications:INVOICE_CREATION_en_US|Template for the email that will be sent when an invoice is created|https://github.com/killbill/killbill-email-notifications-plugin/blob/6fc76403233fd5be290841ee6fc9d728028892f0/src/main/resources/org/killbill/billing/plugin/notification/templates/InvoiceCreation.mustache[_InvoiceCreation.mustache_]
|Upcoming invoices | killbill-email-notifications:UPCOMING_INVOICE_en_US | Template for the email that will be sent when an invoice is due|https://github.com/killbill/killbill-email-notifications-plugin/blob/6fc76403233fd5be290841ee6fc9d728028892f0/src/main/resources/org/killbill/billing/plugin/notification/templates/UpcomingInvoice.mustache[_UpcomingInvoice.mustache_]
|Successful payments |killbill-email-notifications:SUCCESSFUL_PAYMENT_en_US |Template for the email that will be sent when a payment is successful|https://github.com/killbill/killbill-email-notifications-plugin/blob/6fc76403233fd5be290841ee6fc9d728028892f0/src/main/resources/org/killbill/billing/plugin/notification/templates/SuccessfulPayment.mustache[_SuccessfulPayment.mustache_]
|Failed payments |killbill-email-notifications:FAILED_PAYMENT_en_US |Template for the email that will be sent when a payment fails|https://github.com/killbill/killbill-email-notifications-plugin/blob/6fc76403233fd5be290841ee6fc9d728028892f0/src/main/resources/org/killbill/billing/plugin/notification/templates/FailedPayment.mustache[_FailedPayment.mustache_]
|Subscription cancellation (requested date) |killbill-email-notifications:SUBSCRIPTION_CANCELLATION_REQUESTED_en_US |Template for the email that will be sent when a user requests to cancel a subscription|https://github.com/killbill/killbill-email-notifications-plugin/blob/6fc76403233fd5be290841ee6fc9d728028892f0/src/main/resources/org/killbill/billing/plugin/notification/templates/SubscriptionCancellationRequested.mustache[_SubscriptionCancellationRequested.mustache_]
|Subscription cancellation (effective date) |killbill-email-notifications:SUBSCRIPTION_CANCELLATION_EFFECTIVE_en_US |Template for the email that will be sent when a subscription is actually cancelled|https://github.com/killbill/killbill-email-notifications-plugin/blob/6fc76403233fd5be290841ee6fc9d728028892f0/src/main/resources/org/killbill/billing/plugin/notification/templates/SubscriptionCancellationEffective.mustache[_SubscriptionCancellationEffective.mustache_]
|Payment refunds |killbill-email-notifications:PAYMENT_REFUND_en_US |Template for the email that will be sent when a payment is refunded|https://github.com/killbill/killbill-email-notifications-plugin/blob/6fc76403233fd5be290841ee6fc9d728028892f0/src/main/resources/org/killbill/billing/plugin/notification/templates/PaymentRefund.mustache[_PaymentRefund.mustache_]
|Invoice creation |killbill-email-notifications:INVOICE_CREATION_en_US|Template for the email that will be sent when an invoice is created|https://github.com/killbill/killbill-email-notifications-plugin/blob/master/src/main/resources/org/killbill/billing/plugin/notification/templates/InvoiceCreation.mustache[_InvoiceCreation.mustache_]
|Upcoming invoices | killbill-email-notifications:UPCOMING_INVOICE_en_US | Template for the email that will be sent when an invoice is due|https://github.com/killbill/killbill-email-notifications-plugin/blob/master/src/main/resources/org/killbill/billing/plugin/notification/templates/UpcomingInvoice.mustache[_UpcomingInvoice.mustache_]
|Successful payments |killbill-email-notifications:SUCCESSFUL_PAYMENT_en_US |Template for the email that will be sent when a payment is successful|https://github.com/killbill/killbill-email-notifications-plugin/blob/master/src/main/resources/org/killbill/billing/plugin/notification/templates/SuccessfulPayment.mustache[_SuccessfulPayment.mustache_]
|Failed payments |killbill-email-notifications:FAILED_PAYMENT_en_US |Template for the email that will be sent when a payment fails|https://github.com/killbill/killbill-email-notifications-plugin/blob/master/src/main/resources/org/killbill/billing/plugin/notification/templates/FailedPayment.mustache[_FailedPayment.mustache_]
|Subscription cancellation (requested date) |killbill-email-notifications:SUBSCRIPTION_CANCELLATION_REQUESTED_en_US |Template for the email that will be sent when a user requests to cancel a subscription|https://github.com/killbill/killbill-email-notifications-plugin/blob/master/src/main/resources/org/killbill/billing/plugin/notification/templates/SubscriptionCancellationRequested.mustache[_SubscriptionCancellationRequested.mustache_]
|Subscription cancellation (effective date) |killbill-email-notifications:SUBSCRIPTION_CANCELLATION_EFFECTIVE_en_US |Template for the email that will be sent when a subscription is actually cancelled|https://github.com/killbill/killbill-email-notifications-plugin/blob/master/src/main/resources/org/killbill/billing/plugin/notification/templates/SubscriptionCancellationEffective.mustache[_SubscriptionCancellationEffective.mustache_]
|Payment refunds |killbill-email-notifications:PAYMENT_REFUND_en_US |Template for the email that will be sent when a payment is refunded|https://github.com/killbill/killbill-email-notifications-plugin/blob/master/src/main/resources/org/killbill/billing/plugin/notification/templates/PaymentRefund.mustache[_PaymentRefund.mustache_]
|Translation strings |killbill-email-notifications:TEMPLATE_TRANSLATION_en_US |Includes all the text values referenced in the templates. Also includes the email subjects using the following keys:
*upcomingInvoiceSubject
successfulPaymentSubject
Expand All @@ -310,7 +310,7 @@ paymentRefundSubject
subscriptionCancellationRequestedSubject
subscriptionCancellationEffectiveSubject
invoiceCreationSubject*
|https://github.com/killbill/killbill-email-notifications-plugin/blob/6fc76403233fd5be290841ee6fc9d728028892f0/src/main/resources/org/killbill/billing/plugin/notification/translations/Translation_en_US.properties[_Translation_en_US.properties_]
|https://github.com/killbill/killbill-email-notifications-plugin/tree/master/src/main/resources/org/killbill/billing/plugin/notification/translations/Translation_en.properties[_Translation_en.properties_]
|===
=== Uploading a Custom Template
Expand Down Expand Up @@ -352,14 +352,14 @@ curl -v \
--data-binary @/tmp/UpcomingInvoice.mustache \
http://127.0.0.1:8080/1.0/kb/tenants/userKeyValue/killbill-email-notifications:UPCOMING_INVOICE_en_US
. If your template uses some additional keys than what are specified in the https://github.com/killbill/killbill-email-notifications-plugin/blob/6fc76403233fd5be290841ee6fc9d728028892f0/src/main/resources/org/killbill/billing/plugin/notification/translations/Translation_en_US.properties[default translation file], these need to be added to the translation file as explained in the next section.
. If your template uses some additional keys than what are specified in the https://github.com/killbill/killbill-email-notifications-plugin/tree/master/src/main/resources/org/killbill/billing/plugin/notification/translations/Translation_en.properties[default translation file], these need to be added to the translation file as explained in the next section.
[[uploading_resource_files]]
=== Uploading Resource Files
As explained earlier, you can upload additional resource files for different locales or additional keys in existing resource files. In order to do this, please follow the steps given below:
. Check if a resource file https://github.com/killbill/killbill-email-notifications-plugin/blob/6fc76403233fd5be290841ee6fc9d728028892f0/src/main/resources/org/killbill/billing/plugin/notification/translations/[already exists] for your locale. If so, download the file and if not, create a new file. You can use the https://github.com/killbill/killbill-email-notifications-plugin/blob/6fc76403233fd5be290841ee6fc9d728028892f0/src/main/resources/org/killbill/billing/plugin/notification/translations/Translation_en_US.properties[default translation template] as a reference to create a new file.
. Check if a resource file https://github.com/killbill/killbill-email-notifications-plugin/tree/master/src/main/resources/org/killbill/billing/plugin/notification/translations[already exists] for your locale. If so, download the file and if not, create a new file. You can use the https://github.com/killbill/killbill-email-notifications-plugin/tree/master/src/main/resources/org/killbill/billing/plugin/notification/translations/Translation_en.properties[default translation template] as a reference to create a new file.
. Add the required properties (key-value pairs) to your file.
Expand All @@ -379,11 +379,11 @@ http://127.0.0.1:8080/1.0/kb/tenants/userKeyValue/killbill-email-notifications:<
As mentioned earlier, the email notification plugin comes with some https://github.com/killbill/killbill-email-notifications-plugin/tree/master/src/main/resources/org/killbill/billing/plugin/notification/templates[default templates].
For example, the default https://github.com/killbill/killbill-email-notifications-plugin/blob/93115e20e53a25c3c5a58731bc746bc31e8834be/src/main/resources/org/killbill/billing/plugin/notification/templates/InvoiceCreation.mustache[invoice creation] template will result in the following email being sent:
For example, the default https://github.com/killbill/killbill-email-notifications-plugin/blob/master/src/main/resources/org/killbill/billing/plugin/notification/templates/InvoiceCreation.mustache[invoice creation] template will result in the following email being sent:
image::https://github.com/killbill/killbill-docs/raw/v3/userguide/assets/img/invoice_templates/invoice_email.png[align=center]
The default https://github.com/killbill/killbill-email-notifications-plugin/blob/93115e20e53a25c3c5a58731bc746bc31e8834be/src/main/resources/org/killbill/billing/plugin/notification/templates/SubscriptionCancellationEffective.mustache[subscription cancellation] template will result in the following email being sent:
The default https://github.com/killbill/killbill-email-notifications-plugin/blob/master/src/main/resources/org/killbill/billing/plugin/notification/templates/SubscriptionCancellationEffective.mustache[subscription cancellation] template will result in the following email being sent:
image::https://github.com/killbill/killbill-docs/raw/v3/userguide/assets/img/invoice_templates/cancellation_email.png[align=center]
Expand Down

0 comments on commit 458c066

Please sign in to comment.