2024-07-10 19:06:34 +00:00
|
|
|
using BotSharp.Abstraction.Agents;
|
|
|
|
|
using BotSharp.Abstraction.Settings;
|
|
|
|
|
using Microsoft.Extensions.Configuration;
|
|
|
|
|
|
|
|
|
|
namespace BotSharp.Plugin.EmailHandler
|
|
|
|
|
{
|
|
|
|
|
public class EmailHandlerPlugin : IBotSharpPlugin
|
|
|
|
|
{
|
|
|
|
|
public string Id => "a8e217de-e413-47a8-bbf1-af9207392a63";
|
|
|
|
|
public string Name => "Email Handler";
|
|
|
|
|
public string Description => "Empower agent to handle sending out emails";
|
|
|
|
|
public string IconUrl => "https://cdn-icons-png.freepik.com/512/6711/6711567.png";
|
|
|
|
|
|
|
|
|
|
public void RegisterDI(IServiceCollection services, IConfiguration config)
|
|
|
|
|
{
|
|
|
|
|
services.AddScoped(provider =>
|
|
|
|
|
{
|
|
|
|
|
var settingService = provider.GetRequiredService<ISettingService>();
|
2024-07-11 16:02:14 +00:00
|
|
|
return settingService.Bind<EmailHandlerSettings>("EmailHandler");
|
2024-07-10 19:06:34 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
services.AddScoped<IAgentHook, EmailHandlerHook>();
|
|
|
|
|
services.AddScoped<IAgentUtilityHook, EmailHandlerUtilityHook>();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|