Webiant Logo Webiant Logo
  1. No results found.

    Try your search with a different keyword or use * as a wildcard.

RouteProvider.cs

using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Routing;
using Nop.Web.Framework.Mvc.Routing;

namespace Nop.Plugin.Misc.Brevo.Infrastructure;

/// 
/// Represents plugin route provider
/// 
public class RouteProvider : IRouteProvider
{
    /// 
    /// Register routes
    /// 
    /// Route builder
    public void RegisterRoutes(IEndpointRouteBuilder endpointRouteBuilder)
    {
        endpointRouteBuilder.MapControllerRoute(BrevoDefaults.ImportContactsRoute, "Plugins/Brevo/ImportContacts",
            new { controller = "Brevo", action = "ImportContacts" });

        endpointRouteBuilder.MapControllerRoute(BrevoDefaults.UnsubscribeContactRoute, "Plugins/Sendinblue/UnsubscribeWebHook",
            new { controller = "BrevoWebhook", action = "UnsubscribeWebHook" });

        endpointRouteBuilder.MapControllerRoute(BrevoDefaults.UnsubscribeContactRoute, "Plugins/Brevo/UnsubscribeWebHook",
            new { controller = "BrevoWebhook", action = "UnsubscribeWebHook" });
    }

    /// 
    /// Gets a priority of route provider
    /// 
    public int Priority => 0;
}