Genesys CTI User Forum

Genesys CTI User Forum => Genesys-related Development => Topic started by: petitspirou on March 14, 2017, 09:38:04 AM

Title: [SOLVED] Use of MediaEmailCreateNewOutboundEmail
Post by: petitspirou on March 14, 2017, 09:38:04 AM
Hello,

I want to create a new outbound email programmatically
The same action that WDE does when a user clic on the 'mail' icon after typing an email adress

For a call, I use MediaVoiceMakeCall command and it is working well
For email, I try to use MediaEmailCreateNewOutboundEmail command but I fail to find correct parameters

The following code leads to an error "Invalid adress (NULL)":

destinataire = "test@test.com";
IAgent agent = container.Resolve<IAgent>();
IDictionary<string, object> parameters = new Dictionary<string, object>();

parameters.Add("CommandParameter", agent.FirstMediaEmail);
parameters.Add("InitialEmail", destinataire); commandManager.GetChainOfCommandByName("MediaEmailCreateNewOutboundEmail").Execute(parameters);

Can you help me to set the correct parameters?
Title: Re: Use of MediaEmailCreateNewOutboundEmail
Post by: Kubig on March 14, 2017, 09:43:38 AM
What about From Address?
Title: Re: Use of MediaEmailCreateNewOutboundEmail
Post by: petitspirou on March 14, 2017, 10:05:08 AM
Normally, it is not mandatory to specify it in the outbound creation, the agent will select it during redaction

The API is really not clear...

Chain MediaEmailCreateNewOutboundEmail
-IsPossibleToCreate
---CommandParameter: IInteractionInboundEmail
-AddSignatureParameters
---CommandParameter: IMediaOpenMedia
-AddResponseSignatureParameters
---SignatureOptionValue: String
---ESDKInboundEmail: Interaction
---ThreadingOpenMedia
---ParentInteractionId: String
-Create
---CommandParameter: IMediaOpenMedia
---ParentInteractionId: String
---InitialEmail: String
---UserData: KeyValueCollection
---Extensions: KeyValueCollection
---SignatureParameters: Dictionary<string, object>
-AddRecentCall
---RecentIndex: ObjectTC
Title: Re: Use of MediaEmailCreateNewOutboundEmail
Post by: petitspirou on March 14, 2017, 02:02:59 PM
Found

InitialEmail is not the good parameter
I had to add the userdata "To"
Weird API
Title: Re: Use of MediaEmailCreateNewOutboundEmail
Post by: petitspirou on March 29, 2017, 01:54:19 PM
Another question
What parameter control the initial content of an email using MediaEmailCreateNewOutboundEmail?
Title: Re: Use of MediaEmailCreateNewOutboundEmail
Post by: petitspirou on April 03, 2017, 10:40:02 AM
any idea?

It is amazing that the API do not expose such a parameter
Title: Re: Use of MediaEmailCreateNewOutboundEmail
Post by: cavagnaro on April 03, 2017, 12:20:30 PM
What is initial content?

Enviado de meu E6633 usando Tapatalk

Title: Re: Use of MediaEmailCreateNewOutboundEmail
Post by: petitspirou on April 04, 2017, 09:22:40 AM
Subject and Body

Here is the scenario:

- Agent works on his CRM
- In a use case, he clicks on a "create email" button with parameters (email address, subject, message of the email)
- WDE must open a new outbound email window with subject and body already initialized
I tried to fill the param "InitialEmail" but it did nothing

Here is the code of the email creation:

                    IAgent agent = container.Resolve<IAgent>();
                    IDictionary<string, object> parameters = new Dictionary<string, object>();

                    KeyValueCollection kvc = new KeyValueCollection();             
                    kvc.Add("To", destinataire);
                    kvc.Add("Target", destinataire);
                    kvc.Add("Target Type", "TypeDestination");
                    parameters.Add("CommandParameter", agent.FirstMediaEmail);
                    parameters.Add("UserData", kvc);
                    commandManager.GetChainOfCommandByName("MediaEmailCreateNewOutboundEmail").Execute(parameters);

A new outbound email window is created with correct "To"
Title: Re: Use of MediaEmailCreateNewOutboundEmail
Post by: petitspirou on April 06, 2017, 06:12:47 PM
Found the problem

I use agent signature and this override the email content I give to the MediaEmailCreateNewOutboundEmail command
Apparently, it is a "replace" function and not an "add" one....

keys used are:
"Subject", "StructuredText" and "FromAddress"