View Single Post
08/06/19, 06:30 AM   #1
shAndrew
Join Date: Nov 2014
Posts: 3
Automatic ingame email sending with attachments question

Hi all.
Want to implement simple add-on with the following functionality:

From time to time I do Daily craft quests on both of my accounts. After Daily craft quests completed on each char on my second account, I want to send all the looted items to my main account (obviously except the bound items like crafting survey maps). I use Lazy Writ Crafter addon that unpacks all the loot from writ Containers so all of the items will be in chars inventory.

My flow would be the following:
1. Store all items on EVENT_LOOT_RECEIVED event (Filter these with IsItemBound, I guess)
2. Wait for all containers looted/opened
3. Trigger emailing part of this add-on.
4. Build up the email with attachments.
5. Send it with https://wiki.esoui.com/SendMail API func, I guess

Question is: Can you actually attach items to mail? If so - what function I can use to do that?
Also small question about 2nd step. What would be the best approach to wait for the 2nd step to be completed. Add-on will check account name and won't be executed if current account is my main account. Also assuming that all chars on 2nd account will be doing only writs, for now...

NOTE:
Have found these functions in API docs:
CanQueueItemAttachment(number Bag bagId, number slotIndex, number attachmentSlot)
Returns: boolean canAttach

QueueItemAttachment(number Bag bagId, number slotIndex, number attachmentSlot)
Returns: number itemAttachmentResult
Feeling these are what I need but not sure :/

Last edited by shAndrew : 08/06/19 at 06:48 AM. Reason: added NOTES
  Reply With Quote