Email

The Collaboration API contains elements that enable developers to create, store, and manage email and message transactions for use in teamspace operations, such as alerting members to subscribed events. Messages may contain attachments, and may be constructed from templates stored in the Collaboration Store. Key email elements are:

Email Fundamentals

An email object is created when the following information is assembled into an EmailInfo object and added to the target teamspace's email container through the Container object's addContainee method:

Email Containment

In a standard teamspace structure, email messages are created and maintained within the _email folder, a subfolder of the teamspace's _internal folder.

The _email folder is typically accessed by passing the identifier Collaboration.COLLABORATION_EMAIL_CONTAINER_DEFID to the ContainerManager method getContainerByDefinitionID.

Creating a Teamspace Email Object

The following code describes how an Email object might be created in a known object store and teamspace (for information on teamspace objects, see Teamspaces; for information on creating and managing object stores, see the Content Java API topic, Working With Object Stores).

    // create a new EmailInfo object
    EmailInfo emailInfo = new EmailInfo(targetTeamspaceObject, messageContent, ownerID);
    ContainerManager containerManager = containingTeamspace.getContainerManager();
    Container emailContainer = (Container)
      containerManager.getContainerByDefinitionID (Collaboration.COLLABORATION_EMAIL_CONTAINER_DEFID);
    Email emailObject = emailContainer.addContainee(emailInfo);

Additional Information

For information on how teamspace email objects are created and managed within the Team Collaboration Manager application, see Working with Email Functions.