Add email conversation
This commit is contained in:
parent
bca845e572
commit
db92cb3e94
|
|
@ -6,4 +6,5 @@ public class ConversationChannel
|
|||
public const string OpenAPI = "openapi";
|
||||
public const string Phone = "phone";
|
||||
public const string Messenger = "messenger";
|
||||
public const string Email = "email";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,10 +27,11 @@ public class ConversationController : ControllerBase
|
|||
public async Task<ConversationViewModel> NewConversation([FromRoute] string agentId, [FromBody] MessageConfig config)
|
||||
{
|
||||
var service = _services.GetRequiredService<IConversationService>();
|
||||
var channel = config.States.FirstOrDefault(x => x.Key == "channel");
|
||||
var conv = new Conversation
|
||||
{
|
||||
AgentId = agentId,
|
||||
Channel = ConversationChannel.OpenAPI,
|
||||
Channel = channel == default ? ConversationChannel.OpenAPI : channel.Value,
|
||||
TaskId = config.TaskId
|
||||
};
|
||||
conv = await service.NewConversation(conv);
|
||||
|
|
|
|||
Loading…
Reference in a new issue