Add email conversation

This commit is contained in:
Visagan Guruparan 2024-06-24 16:39:53 -05:00
parent bca845e572
commit db92cb3e94
2 changed files with 3 additions and 1 deletions

View file

@ -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";
}

View file

@ -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);