Hey Jess. Thanks for the detailed response and especially for the link to the constant values article. Since the original post, we have shifted to using constants to define settings.
For bonus points, it’s also helpful to define conditional constants for WPMS in wp-config.php based on the hosting environment. For example, we define PHP Mailer constants for our development environment, which is configured to send all mail to a specific test account. In production, we configure email to be sent using SendGrid.
This enables us to migrate sites between development, staging and production environments without worrying about transactional email. Here’s a snippet of what we use:
if ( ! preg_match( '/(^dev\.)|(\.dev$)/', $_SERVER['HTTP_HOST'] ) ) {
// Production environment only
define( 'WPMS_MAILER', 'sendgrid' );
define( 'WPMS_SENDGRID_API_KEY', 'API key required' ); // Enter SendGrid API key
} else {
// Development environment only
define( 'WPMS_MAILER', 'mail' );
}