ActiveCampaign / postmark-wordpress

The Official Postmark Wordpress Plugin
GNU General Public License v2.0
18 stars 17 forks source link

Allow Settings to be Overridden by Constants #79

Closed tflight closed 3 years ago

tflight commented 3 years ago

This needs review and documentation before merging.

This PR allows you to set constants in your wp-config.php file which will override, but not overwrite, any settings stored in the database (WP options). API Key, Stream Name/ID, and Sender Address are supported. Example config:

// setup Postmark constants
define('POSTMARK_API_KEY', 'xyz-123-abc');
define('POSTMARK_STREAM_NAME', null);
define('POSTMARK_SENDER_ADDRESS', 'from-constans@example.com');

An example usage would be for a developer to use settings from a Postmark Sandbox stream in their development environment that would survive database merges. See #71. This also helps address #72.

pgraham3 commented 3 years ago

@tflight Thanks for putting this PR together! I will review it this week.