Production and Test environments
Every Courier tenant has two notification development environments: "Live" and "Test". The two environments are isolated from one another, and all the assets within them (templates, brands, tags, categories integrations, API keys, log data, etc.) belong only to that environment.
Any changes made to a template and its associated assets are only applied within the current environment until you migrate the template and overwrite any changes to the corresponding Notification ID and assets in the other environment.
Switching between Live and Test environments
Use the Environments toggle in the right-side menu to switch between your Production and Test environments. Look for the 'Test Data' indicator at the top of the application window to confirm that you're in the test environment.
Note: Simply switching from Live to Test does not impact your notifications in either environment in any way. It just changes the environment you are viewing.
API keys and environments
Within each environment, Production and Test, there are two states: draft and published. Each state has its own unique API key, giving you four distinct API keys
The keys are prefaced in a way that helps you identify which key you are using.
pk_prod_ = The API key for your published data in the Production environment
dk_prod_ = The API key for your draft data in the Production environment
pk_test_ = The API key for your published data in the Test environment
dk_test_ = The API key for your draftdata in the Test environment
Business-tier Feature: Generate new API keys
Courier customers with a Business contract have the ability to create new API keys and have more than 2 keys per environment to enable additional development workflows.
Define the routing behavior of custom API Keys
In addition to the ability to create new API Keys, Business Tier customers can define the routing behavior of their API Keys. A "mock" key will simulate the Courier notification/message lifecycle - but won't invoke the downstream provider. This lets you see how the request flows inside of Courier without incurring any send cost.
Notifications, assets and environments
The environments feature allows you to move a template and its associated assets (like Brands, Tags and Categories) between environments. You can move them from Test to Production and from Production to Test. You can also select the destination Tenant when migrating assets.
In order to copy a template between environments. Courier must also copy all dependencies attached to the template to ensure functionality is preserved. After you've copied associated assets once (e.g. Brand, Category), you will have the option to overwrite those in future migrations.
Note: Courier will copy the current template. All other assets copied will be their most recent published version.
How to migrate templates and assets between environments:
Open the notification you wish to migration
Open the dropdown menu in the 'Publish Changes' button.
Select 'Copy Assets'
4. Click either 'Copy Assets' or 'Copy And Publish' option.
Event mapping and template migration
If you have an event mapped to a template that you are migrating between environments, the event and its mapping will automatically migrate as well.
If the associated event is already mapped to a different template in the destination environment, then you will receive an error:
Integrations and environments
Your integrations exist across environments, so you only need to add your integration once and it will be available in both Production and Test.
Adding a test environment configuration
By default, all of your integrations work in both the test and production environments. But, if you’d prefer an extra layer of security, you can add a test API key for your integration that will only send notifications from Courier’s test environment.
The Test Configuration means Courier will use this configuration when sending a notification using a test API Key.
Data logs, metrics, and environments
Your Data Logs and Metrics are environment-specific. Sends of Notifications using the pk_test_ and dk_test_ keys will only appear in the Data and Metrics dashboard of the Test environment. While pk_prod_ and dk_prod_ sends will only appear in the Data Logs and Metrics for the Production environment.
Courier APIs (Lists, Events, Profiles, Preferences, etc.) and Environments
The environment and state-specific API key (pk_prod_, dk_prod_, pk_test_, dk_test_) you use when interacting with Courier's APIs will perform the command for that environment and state only.
In other words, if you create a list via the Lists API using the Draft Test API key (dk_test_), you will create a list that can only be used to send notifications in the draft state in the Test environment.
Segment and environments
To use Courier environments with Segment, create multiple Courier sources in Segment with different Environment API keys.
One way to implement this could be:
Send your production data from Segment to your Courier production environment using the published Production key ‘pk_prod_’.
Set up a second destination to send data from Segment to your Courier Test environment using the published Test key ‘pk_test_’.
Map the Track events to your templates in the test environment.
For more details, read our help article: “Setting up Courier's Segment integration”.
Environments and billing
Note that billing takes both test and production sends into account.
To share bug reports, feedback, and feature requests, email: firstname.lastname@example.org.