com.genesyslab.ail
Interface InteractionMailIn

All Superinterfaces:
AbstractInteraction, IdObject, Interaction, InteractionMail, InteractionMultimedia, Possible, Savable
All Known Subinterfaces:
InteractionInvitationIn, InteractionInvitationParentIn

public interface InteractionMailIn
extends InteractionMail

This interface is for managing an inbound e-mail.

It provides the following actions:

For details about these actions, see the corresponding methods.

To get instances of this interface, your application listens for InteractionEvent events, which indicate ringing inbound e-mail interactions.

To receive InteractionEvent events for inbound e-mail interactions, use a PlaceListener (or an AgentListener) added to a Place (or Agent) object that includes the e-mail media. For each new inbound e-mail, your application receives an InteractionEvent for an InteractionMailIn interaction that has an Interaction.Status.RINGING status, as shown in the following code snippet.

public class SimplePlaceExample implements PlaceListener
{
    public SimplePlaceExample(Place examplePlace)
    {
        examplePlace.addPlaceListener(this);
    }
    //...
    public void handleInteractionEvent(InteractionEvent event)
    {
        //Getting a new inbound e-mail
        if((event.getStatus()==Interaction.Status.RINGING)
        && (event.getSource() instanceof InteractionMailIn) )
        {
            //Managing the new inbound e-mail
            //...
        }
        //...
    }
    //...
}

To determine which actions are available at a certain time, test the corresponding InteractionMailIn.Action value by calling the isPossible method. For example, use the possible actions to activate or deactivate buttons that make calls to the corresponding InteractionMailIn methods.

After invoking the answerCall method to acknowledge the handling of the interaction, your application receives another InteractionEvent event propagating the status of the interaction changed to Interaction.Status.TALKING.

You can now access the incoming e-mail content, then create a replying InteractionMailOut interaction by calling the reply(java.lang.String, boolean) method.


Nested Class Summary
static class InteractionMailIn.Action
          Actions possible on incoming e-mails.
 
Nested classes/interfaces inherited from interface com.genesyslab.ail.InteractionMultimedia
InteractionMultimedia.StopProcessingReason
 
Nested classes/interfaces inherited from interface com.genesyslab.ail.Interaction
Interaction.Status, Interaction.Type
 
Nested classes/interfaces inherited from interface com.genesyslab.ail.AbstractInteraction
AbstractInteraction.AbstractCallType
 
Field Summary
 
Fields inherited from interface com.genesyslab.ail.InteractionMail
QUOTE_HEADER_CONTACT, QUOTE_HEADER_DATE
 
Method Summary
 InteractionMailOut getCurrentReplyMailOut()
          Returns the current e-mail answering to this e-mail, if any.
 java.util.Map getCustomData()
          Returns the custom data associated with this interaction if it is an e-mail request.
 EmailAddress getExternalAgentTransferAddress()
          Returns the e-mail address of the external agent to whom this e-mail had been transferred.
 java.lang.String getMailbox()
          Returns the name of the mailbox into which this email has arrived.
 EmailAddress getReplyToAddress()
          Returns the reply-to address of this e-mail.
 boolean isEscalated()
          Returns true if this e-mail was escalated.
 InteractionMailOut reply(java.lang.String queue, boolean reply_all)
          Deprecated. since 7.5 Please use reply(String, boolean, boolean).
 InteractionMailOut reply(java.lang.String queue, boolean reply_all, boolean markdone)
          Creates a reply to this e-mail.
 void transferExternalAgent(EmailAddress ext_agt_email, java.lang.String queue)
          Transfers this e-mail to an external agent.
 
Methods inherited from interface com.genesyslab.ail.InteractionMail
getAttachment, getAttachments, getCcAddresses, getDateSent, getFromAddress, getMessageText, getMimeMessage, getToAddresses, hasAttachments
 
Methods inherited from interface com.genesyslab.ail.InteractionMultimedia
addSuggestedCategories, delete, getAvailableQueuesForChildInteraction, getAvailableQueuesForThisInteraction, getCategoryId, getExternalId, getInteractionSubtype, getInteractionType, getIsCategoryApproved, getMaxSubjectLength, getMediaType, getQueue, getSuggestedCategories, isMarkDoneAvailable, placeInQueue, setAttachedData, setAvailableQueuesForChildInteraction, setAvailableQueuesForThisInteraction, setCategoryId, setExternalId, setIsCategoryApproved, submit, transferAgent, transferPlace, transferQueue
 
Methods inherited from interface com.genesyslab.ail.Interaction
answerCall, countOtherPendingInteractions, getContactId, getContentBinary, getContentBinaryMimeType, getContentBinarySize, getDateCreated, getDn, getEndDate, getMedia, getNotepad, getParentInteraction, getPlace, getStatus, getStructTextMimeType, getStructuredText, getSubject, getText, getType, getUserName, isDone, markDone, merge, releaseCall, save, setContactId, setContentBinary, setContentBinaryMimeType, setContentBinarySize, setNotepad, setStructTextMimeType, setStructuredText, setSubject, setText
 
Methods inherited from interface com.genesyslab.ail.AbstractInteraction
addInteractionListener, getAttachedData, getAttachedData, getAttachedDataEx, getTConnectionId, queryStatus, removeAttachedData, removeInteractionListener, saveAttachedData, setAttachedData
 
Methods inherited from interface com.genesyslab.ail.Possible
arePossible, isPossible
 
Methods inherited from interface com.genesyslab.ail.Savable
getContactServerId, isDirty
 

Method Detail

reply

InteractionMailOut reply(java.lang.String queue,
                         boolean reply_all)
                         throws RequestFailedException
Deprecated. since 7.5 Please use reply(String, boolean, boolean).

Creates a reply to this e-mail. The returned InteractionMailOut can be edited and sent.

Parameters:
queue - the queue into which the reply will be submitted.
reply_all - true for replying to all the recipients of this e-mail, false to reply to the sender only.
Returns:
the reply to this e-mail.
Throws:
RequestFailedException

reply

InteractionMailOut reply(java.lang.String queue,
                         boolean reply_all,
                         boolean markdone)
                         throws RequestFailedException
Creates a reply to this e-mail. The returned InteractionMailOut can be edited and sent.

Parameters:
queue - the queue into which the reply will be submitted.
reply_all - true for replying to all the recipients of this e-mail, false to reply to the sender only.
markdone - allows to markdone automatically the parent InteractionMailIn.
Returns:
the reply to this e-mail.
Throws:
RequestFailedException
Since:
7.5.

getCurrentReplyMailOut

InteractionMailOut getCurrentReplyMailOut()
Returns the current e-mail answering to this e-mail, if any.

Returns:
null if there is no current answer.

transferExternalAgent

void transferExternalAgent(EmailAddress ext_agt_email,
                           java.lang.String queue)
                           throws RequestFailedException
Transfers this e-mail to an external agent.

Parameters:
ext_agt_email - the e-mail address of the external agent.
queue - the queue used for transferring an e-mail to an external agent.
Throws:
IsServiceException - if there is a problem with the Interaction Server.
RequestFailedException

isEscalated

boolean isEscalated()
Returns true if this e-mail was escalated. An e-mail that has been transferred to an external agent and that is routed back to an internal agent is considered as being escalated until a reply is sent, or the e-mail is marked done or deleted by an internal agent.


getExternalAgentTransferAddress

EmailAddress getExternalAgentTransferAddress()
Returns the e-mail address of the external agent to whom this e-mail had been transferred.

Returns:
null if this e-mail had not been transferred to an external agent.

getCustomData

java.util.Map getCustomData()
                            throws RequestFailedException
Returns the custom data associated with this interaction if it is an e-mail request.

Returns:
a Map of (String, String).
Throws:
RequestFailedException

getMailbox

java.lang.String getMailbox()
Returns the name of the mailbox into which this email has arrived.

Since:
7.6.4
See Also:
AilFactory.getIncomingAddress(String)

getReplyToAddress

EmailAddress getReplyToAddress()
                               throws RequestFailedException
Returns the reply-to address of this e-mail.

Returns:
an EmailAddress object.
Throws:
RequestFailedException
Since:
7.5.