From 3c008fb129bbddf46a44ea2a9924c81e7cd9a08e Mon Sep 17 00:00:00 2001 From: Freeman Date: Wed, 30 Aug 2023 03:18:38 +0200 Subject: [PATCH] mail when money transfer again --- receive_fields_wt.lua | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/receive_fields_wt.lua b/receive_fields_wt.lua index b4693bc..efb5297 100644 --- a/receive_fields_wt.lua +++ b/receive_fields_wt.lua @@ -71,8 +71,18 @@ minetest.register_on_player_receive_fields(function(player, form, pressed) atm.write_transaction(t.to) atm.save_account(n) atm.save_account(t.to) + if minetest.get_modpath("mail") and mail.send then + mail.send({ + from = "Emerald Bank", + to = t.to, + --cc = "carbon, copy", + --bcc = "blind, carbon, copy", + subject = S("Payment of @1 to @2 completed", t.sum, n), + body = S("Good news!\n\n@1 has transferred @2 emeralds to your bank account using the Emerald Bank Transfer System.\n\nTransfer description:\n\n@3", n, t.sum, t.desc) + }) + end minetest.chat_send_player(n, S("Payment of @1 to @2 completed", t.sum, t.to)) - minetest.chat_send_player(n, S("@1, thank you for choosing the Wire Transfer system", n)) + minetest.chat_send_player(n, S("@1, thank you for choosing the Emerald Bank Transfer system", n)) if t.callback then -- run callbacks from mods t.callback(t) end