Send Mail - Used to send a mail - Preview
SendMail
lua-- 'source' or 'phoneNumber' or 'phoneImei' or 'all' local receiverType = 'all' -- phone number or phone imei or source id or empty if `receiverType` is 'all' local receiver = '088-888-8888' --local receiver = GetPlayerServerId(PlayerId()) // Use it to get the source id of the player if you're using it in a client script. -- email - table -- email.title - string, title(subject) of the email -- email.sender - string, email of the sender -- email.senderDisplayName - string, display name of the sender -- email.content - string, content of the email -- email.actions - table(optional), button actions to add to the email -- email.attachments - table(optional), attachments to add to the email(photo, location) -- toType: string, type of recipient, can be "phoneNumber" or "phoneImei" or "all" -- to: string, recipient's phone number or imei or empty if `toType` is 'all' (optional) local insertId, received = exports.yseries:SendMail({ title = "Email title", sender = 'phone@yflip.com', senderDisplayName = 'YFlip Phone', content = 'Email content', actions = { -- actions are optional { label = "Accept", data = { event = "yseries:client:mail:test-callback", isServer = false, data = "test data", -- if *true: the email tab will be closed after the callback is executed, *false: keep the email details tab open shouldClose = true } }, { label = "Decline", data = { event = "yseries:client:mail:test-callback", isServer = true, data = "test data", shouldClose = false } } }, attachments = { { photo = "https://i.imgur.com/2QZQ5kL.png" }, { location = { x = 10, y = 10 } } } }, receiverType, receiver)
DeleteMail
lua---@param id string The id of the mail ---@return boolean local success = exports.yseries:DeleteMail(id)