mail when money transfer

master
Freeman 10 months ago
parent 52a94b8f79
commit cd09c07c98

@ -484,8 +484,18 @@ function emeraldbank.wt_receive_fields(player, form, pressed)
atm.balance[t.to] = atm.balance[t.to] + t.sum
atm.write_transactions()
atm.saveaccounts()
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 emeralds from @2", 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

Loading…
Cancel
Save