Trying to alert the user when they have unlocked a new tmog in the wardrobe (very much like the current blizz chat message but for any quality items) and have come up with a solution however it only seems to work half the time. Im new to LUA so might have missed something obvious :P
Every time a TRANSMOG_COLLECTION_UPDATED fires, I get the latest appearance (C_TransmogCollection.GetLatestAppearance) and from that, get the first source from that appearance ID (C_TransmogCollection.GetAppearanceSources) and display its name in the chat (C_TransmogCollection.GetAppearanceSourceInfo contains the items name). This works very well however, it seems like half the time, GetAppearanceSourceInfo returns nil.
For a normal item, the GetAppearanceSourceInfo returns this:
EDIT: Solved! There might be multiple sources for a transmog item, some may even be different armour type. Its not safe just taking the first source as it causes nil values if you cant equip it. Search through them all to find your armour type