Get ContactID when a Contact is updated

Get ContactID when a Contact is updated

I'm using this code from a previous question to update a field in a Contact whenever a Contact receives an email:
  1. //access the emails field from the Contact
  2. emailInfo = zoho.crm.getRelatedRecords("Emails", "Contacts", --yourcontactID--);
  3. //create a list of every email from that Contact
  4. emailList = emailInfo.get("email_related_list");
  5. //count the number of emails in that list
  6. count = emailList.size();
  7. //if the number of the emails in the list is greater than 0, get the most recent email's Created Time date
  8. if(count > 0)
  9. {
  10. mostRecentDate = emailList.get(0).get("Created Time");
  11. for each i in emailList
  12. {
  13. if(i.get("Created Time") > mostRecentDate)
  14. {
  15. mostRecentDate = i.get("Created Time");
  16. }
  17. }
  18. // Update the Last Contact Date with that date
  19.         mapUp = Map();
  20. mapUp.put("Latest_Outreach",mostRecentDate);
  21.         response = zoho.crm.updateRecord("Contacts", --yourcontactID--);
  22. }
  23. return;
Where it says "--yourcontactID--", I need to get the specific Contact's ID as a variable into that space. So I need a function that, when an action happens -- in this case, when a Contact gets an new email attached to it-- that Contact's ID is captured and that ID is then used in the code above.

Here's how I'd like it to work:
1. An email is attached to a Contact using the BCC dropbox
2. A workflow action is triggered and runs the code above
3. At the start of that code, the ContactID is captured and set to a variable
4. The rest of the above code executes