nopSolutions/nopCommerce · error · NopException
Plugin not configured
Error message
Plugin not configured
What it means
Thrown by BrevoManager.HandleFunctionAsync as a NopException when LoadSettingAsync<BrevoSettings>() fails the IsConfigured check. HandleFunctionAsync wraps every Brevo API call, so any Brevo operation (email send, contact sync, etc.) fails fast if the plugin is not configured. The exception is then caught, logged, and returned as an error string to the caller.
Source
Thrown at src/Plugins/Nop.Plugin.Misc.Brevo/Services/BrevoManager.cs:101
/// <summary>
/// Handle function and get result
/// </summary>
/// <typeparam name="TResult">Result type</typeparam>
/// <param name="function">Function</param>
/// <param name="logErrors">Whether to log errors</param>
/// <returns>
/// A task that represents the asynchronous operation
/// The task result contains the result; error if exists
/// </returns>
private async Task<(TResult Result, string Error)> HandleFunctionAsync<TResult>(Func<Task<TResult>> function, bool logErrors = true)
{
try
{
//whether plugin is configured
var brevoSettings = await _settingService.LoadSettingAsync<BrevoSettings>();
if (!IsConfigured(brevoSettings))
throw new NopException("Plugin not configured");
return (await function(), default);
}
catch (Exception exception)
{
var errorMessage = exception.Message;
if (logErrors)
{
var logMessage = $"{BrevoDefaults.SystemName} error: {Environment.NewLine}{errorMessage}";
await _logger.ErrorAsync(logMessage, exception, await _workContext.GetCurrentCustomerAsync());
}
return (default, errorMessage);
}
}
/// <summary>
/// Prepare API clientView on GitHub (pinned to 64bdf2ff08)
Solutions
- Open the Brevo plugin configuration and enter a valid Brevo API key and required sender settings, then save.
- Verify the settings are saved for the correct store scope in multi-store setups.
- Check the log for the 'Brevo error: Plugin not configured' message to confirm which operation triggered it.
Example fix
// before: BrevoSettings empty/unconfigured // after: in plugin config settings.ApiKey = "<Brevo API key>"; settings.SenderEmail = "noreply@example.com"; settings.SenderName = "Shop"; await _settingService.SaveSettingAsync(settings, storeScope);
Defensive patterns
Strategy: validation
Validate before calling
var s = await _settingService.LoadSettingAsync<BrevoSettings>();
if (!IsConfigured(s))
// skip Brevo-dependent operation, return empty result, surface admin warning Type guard
static bool IsBrevoReady(BrevoSettings s) =>
!string.IsNullOrEmpty(s.ApiKey); // plus whatever IsConfigured requires Try / catch
var (result, error) = await _brevoManager.HandleFunctionAsync(() => SendAsync(msg));
if (!string.IsNullOrEmpty(error)) logger.Warn($"Brevo operation failed: {error}"); Prevention
- Save Brevo API key/sender before enabling features that use it.
- Use HandleFunctionAsync's returned error string to drive admin notifications.
- Add a startup config check for Brevo.
When it happens
Trigger: Any Brevo operation invoked before the BrevoSettings (API key / sender credentials) have been saved. Because HandleFunctionAsync catches and logs, the caller receives (default, errorMessage) rather than a thrown exception in normal flows.
Common situations: Plugin installed/enabled but API key not entered; settings cleared; wrong store scope; environment using a Brevo-dependent feature (newsletter, SMTP) without configuring Brevo first.
Related errors
- Facebook authentication module not configured
- Azure connection string for Blob is not specified
- Archive '{NopCommonDefaults.LocalePatternArchiveName}' to re
- Plugins.ExchangeRate.EcbExchange.Error
- Facebook authentication module cannot be loaded
AI-assisted analysis of nopSolutions/nopCommerce@64bdf2ff08 (2026-08-13).
Data as JSON: /api/errors/d3414dbec2eec572.
Report an issue: GitHub.