Sometimes super admins need a setting to be mandatory across the whole network — for example, every sub-site must use the same transactional SMTP account, or the failure-alert recipient must always be the platform operator.
NimblyMail exposes two mechanisms for this: PHP constants (strongest, read-only everywhere) and network locks (configured in the admin UI).
PHP Constants (Strongest)
Define the constant in wp-config.php before the ABSPATH line:
define( 'NIMBLY_MAIL_MAIL_FROM', '[email protected]' );
define( 'NIMBLY_MAIL_MAIL_FROM_NAME', 'Platform Support' );
define( 'NIMBLY_MAIL_SMTP_HOST', 'smtp.mailgun.org' );
define( 'NIMBLY_MAIL_SMTP_PASS', 'key-xxxxxxxxxxxx' );
Any field backed by a constant:
- Ignores the DB value at every layer (network, site, even a network lock).
- Displays a Defined in wp-config.php badge next to the field in the admin UI.
- Becomes read-only in the settings form for every user, including super admins.
Use constants for credentials you don’t want in the database at all, or for network-wide policy that must survive accidental UI edits.
See Advanced Settings for the full list of constant names.
Network Locks (UI-Managed)
A network lock is a softer mechanism, set by a super admin from Network Admin > NimblyMail > Settings. For any field you want to freeze across the network:
- Enter the value you want every sub-site to use.
- Click the lock icon next to the field (only visible on the network settings editor).
- Save the network settings.
Locked fields behave like this across the network:
- Sub-site admins see a Locked by network badge and a disabled input showing the locked value.
- Sub-site admins cannot change the value or create an override on that field.
- Existing site-level overrides for a locked field are ignored by the resolver — the network lock takes precedence.
- The
Reset to network defaultsbutton in the sub-site section skips locked fields (they cannot be changed anyway).
When to Use Which
| Situation | Mechanism |
|---|---|
| Credentials that should never be in the DB | PHP constant |
| A single SMTP endpoint for the whole network | PHP constant or Network lock |
| A standard From Email across the platform | Network lock (lets you change it in UI without deploys) |
| A required failure-alert recipient | Network lock |
| A sub-site-specific SMTP account | No lock — configure as site override |
Unlocking a Field
To remove a network lock, toggle the lock icon off under Network Admin > NimblyMail > Settings and save. Sub-sites revert to normal inheritance: they’ll use the network default until they set their own override.
PHP constants cannot be unlocked from the UI. Remove the define() line from wp-config.php and reload.
