Thread: Mail API
View Single Post
03/09/15, 02:56 PM   #3
Argusus
AddOn Author - Click to view addons
Join Date: Sep 2014
Posts: 120
Thanks for your response, I will have to test out and see if the getnextmailid is indeed the correct mail id for the response when EVENT_MAIL_READABLE and it passes the mail id that was selected , if so this would work. Just really wanting to be able to establish/find a relationship between a send and reply. With out comparing title or something else.



Originally Posted by Baertram View Post
Ok, as your threads are duplicate I'll answer you here and remove the other post in your old thread:

I only know of the following EVENTS that trigger upon incoming emails or interaction with the MAIL_INBOX:

Lua Code:
  1. EVENT_MAIL_INBOX_UPDATE
  2. EVENT_MAIL_READABLE
  3. EVENT_MAIL_TAKE_ATTACHED_ITEM_SUCCESS
  4. EVENT_MAIL_TAKE_ATTACHED_MONEY_SUCCESS
  5. EVENT_MAIL_REMOVED
  6. EVENT_MAIL_NUM_UNREAD_CHANGED

You could use EVENT_MAIL_READBALE e.g. and register a new callback function and check the incoming COD amount by help of the mail id.

Or you Pre-hook this function here to above to get the COD amount:
Lua Code:
  1. function ZO_MailInboxShared_PopulateMailData(dataTable, mailId)
  2.     local senderDisplayName, senderCharacterName, subject, icon, unread, fromSystem, fromCS, returned, numAttachments, attachedMoney, codAmount, expiresInDays, secsSinceReceived = GetMailItemInfo(mailId)
  3.     dataTable.mailId = mailId
  4.     dataTable.subject = subject
  5.     dataTable.returned = returned
  6.     dataTable.senderDisplayName = senderDisplayName
  7.     dataTable.senderCharacterName = senderCharacterName
  8.     dataTable.expiresInDays = expiresInDays
  9.     dataTable.unread = unread
  10.     dataTable.numAttachments = numAttachments
  11.     dataTable.attachedMoney = attachedMoney
  12.     dataTable.codAmount = codAmount
  13.     dataTable.secsSinceReceived = secsSinceReceived
  14.     dataTable.fromSystem = fromSystem
  15.     dataTable.fromCS = fromCS
  16.     dataTable.priority = fromCS and 1 or 2
  17.     dataTable.GetFormattedSubject = GetFormattedSubject
  18.     dataTable.GetExpiresText = GetExpiresText
  19.     dataTable.GetReceivedText = GetReceivedText
  20. end

If it is 0 the other one did not accept it, I guesss.

I'm not sure if the MailID is the same as the send one but would make sense I guess.
  Reply With Quote