Automatic email notification upon receipt of a Bitcoin payment

This post is also available in: German

Be automatically notified by email when a Bitcoin payment is received

When payment is received on your Bitcoin Wallet, you usually want to be informed quickly by email.

This notification is usually done automatically by the online shop software such as WooCommerce.

With Bitcoin you can also receive payments without running an online shop.

You can receive Bitcoin payments by Pay button, by donation, to pay for a newspaper article or through any of the other applications presented here and you can also be informed about these Bitcoin payments by email.

In this article we will explain how the BTCPay Server and BTC Transmuter will automatically inform you by email about every incoming payment on your Bitcoin Wallet.

Email notification with BTCPay Transmuter

As soon as a payment is received on our Bitcoin Wallet, we would like to be notified by email. This can be implemented with the aid of BTCPay transmuter. BTCPay Transmuter is a part of BTCPay Server In the article “BTCPay Transmuter” we introduce this service and there you will also find an explanation how to set up BTCPay Transmuter on your BTC Pay Server. If you have set up a shop at https://demo.coincharge.io you can also use BTCPay Transmuter and get informed by email about incoming payments.

With BTCPay Transmuter there are some prepared functions, which can be adapted to your own requirements.

email notification

Under BTCPay Email Receipts there is a template based on the sale of an event ticket. We will modify and adapt this template.

As first setting, you have to define for which BTCPay store on your BTCPay server this application should be used. Also an email must be deposited, which is used for sending the email notification.

These are External Services, which can be set up and administered under this separate menu item.

If these corresponding External Services do not yet exist, they must still be created and it looks as follows

BTCTransmuter Email Notification

We would like to be notified by email for our Supporter Shop at https://store.coincharge.iowhen a payment has been received.

Pairing with the BTCPay Store

In the first step you must establish a connection to your BTCPay store. An External Service must be created for this purpose.

You give this service a name (here Supporter-Shop) and select External Service as Type BTCPayServer.

Create External Service

Then you have to connect this External Service with the BTCPay Store on the BTCPay Server.

This process is called pairing and requires the paring code of the shop.

Pairing with BTCPay Server

Then you click on Save and leave the field empty. You will see a link that you have to click on.

Pairing Code

You will then be forwarded to the backend system of your BTCPay server and have to select your BTCPay store.

Pairing Permission

Then you click on Approve. This allows transmitters to access the information of your BTCPay store.

After you have clicked Appove, you go back to Transmuter in the External Services area. There to the settings of the shop and click there on Save.

Then the field Last Checked should be displayed with a date.

Edit External Service

Email Sending Service

Then the Email Sending Service must be set up. This service is required because notifications are sent via these email settings.

Create BTCPay Email Receipts

We also give this service a name and select SmtpExternalService as type.

Create SMTP External Service

Then we have to deposit the data from our used email address.

BTC Transmuter Smtp External Service

and save it. Then we test whether the email settings have been successfully stored and send us a text message.

I had some problems with the mail server settings. Sometimes the displayed error messages are wrong or misleading.

After trying for a while, deactivating SSL and another browser, it finally worked.

After the two External Services have been set up, the External Services section will show the services we have newly set up:

External Services

email notification

We have determined for which shop and via which email address the email notification should be sent.

In the next step, we define which message should be sent when which event occurs.

We would like to receive an email notification when a payment in our shop receives a certain status. In the shop settings the different statuses are recorded in the Invoices area.

Invoices in the Supporter Shop

If the status changes to Complete, we would like to be informed by email.

Invoice Status

Then you can define who should be notified by email.

If the customer should also be sent an email, we will check the box “Send email to the address registered on the BTCPay invoice”.

Since we want to be informed by email ourselves, we enter our own email address.

Then you can specify which email address should be displayed as the sender email address and the email subject.

The email body can be converted via HTML. In the email text data from the order or invoice can be transferred.

This could be, for example:

  • Customer Email: {{TriggerData.Invoice.Buyer.email}}
  • Invoice Id: {{TriggerData.Invoice.Id}}
  • Invoice Status: {{TriggerData.Invoice.Status}}
  • Amount Paid in BTC: {{TriggerData.Invoice.BtcPaid}}
  • Amount Due: {{TriggerData.Invoice.Price}}
  • Invoice Currency: {{TriggerData.Invoice.Currency}}
  • Item Description: {{TriggerData.Invoice.ItemDesc}}
  • Invoice Url: {{TriggerData.Invoice.Url}}

There is already something stored in the template, but this can be edited and changed accordingly.

Email Body Text

After we have saved, the following overview appears.

BTC Transmuter Trigger and Action

The division is divided into Trigger and Action. Under the item Trigger we have defined which event must occur for something to happen. We had specified as a trigger that something should happen when the event payment “Complete” occurs.

What should happen then is called action. In our case an email with a certain content should be sent to the customer and additionally to ourselves.

With these settings we are now always informed by email when a payment has been successfully received in our Supporter Shop.

Using the trigger and action functions of BTCPay Transmuter, you can create various actions yourself to adapt the functionality of the BTCPay server to individual requirements.

Further application examples that we present here are:

This post is also available in: German

Leave a reply