Hi Sam.
Not sure if you solved this but...
// Get the Case by:
object caseObject;
contextDictionary.TryGetValue("Case", out caseObject);
ICase case = caseObject as ICase;
// Get the main interaction from the case....
IInteraction interaction = theCase.MainInteraction;
// see if it is an inbound email...
if (interactionType.ToUpper() == "INTERACTIONINBOUNDEMAIL")
{
IInteractionInboundEmail inboundEmail = interaction as IInteractionInboundEmail;
var attachedData = inboundEmail.GetAllAttachedData();
string fromAddress = attacheData["EmailAddress"];
// etc etc.
}
You would obviously make the above robust by making sure your objects are valid before using them as well to avoid exceptiins.