diff --git a/wrapper.lua b/wrapper.lua index d7d3b3a..3eec5b8 100644 --- a/wrapper.lua +++ b/wrapper.lua @@ -1291,6 +1291,9 @@ function sendPhoneMail(data) local phoneResource = "" elseif GetResourceState("qb-phone"):find("start") then phoneResource = "qb-phone" TriggerServerEvent('qb-phone:server:sendNewMail', data) + + elseif GetResourceState("jpr-phonesystem"):find("start") then phoneResource = "jpr-phonesystem" + TriggerServerEvent(GetCurrentResourceName()..":jpr:SendMail", data) end if phoneResource ~= "" then if Config.System.Debug then print("^6Bridge^7[^3"..phoneResource.."^7]: ^2Sending mail to player") end @@ -1323,6 +1326,19 @@ RegisterNetEvent(GetCurrentResourceName()..":yflip:SendMail", function(data) }, 'source', src) end) +RegisterNetEvent(GetCurrentResourceName()..":jpr:SendMail", function(data) + local QBCore = exports['qb-core']:GetCoreObject() + local src = source + local Player = QBCore.Functions.GetPlayer(src) + TriggerEvent('jpr-phonesystem:server:sendEmail', { + Assunto = data.subject, -- Subject + Conteudo = data.message, -- Content + Enviado = data.sender, -- Submitted by + Destinatario = Player.PlayerData.citizenid, -- Target + Event = {}, -- Optional + }) +end) + function registerCommand(command, options) if GetResourceState(OXLibExport):find("start") then if Config.System.Debug then print("^6Bridge^7: ^2Registering ^3Command^2 with ^7"..OXLibExport, command) end