SparkPost / wordpress-sparkpost

WordPress plugin to use SparkPost email
https://wordpress.org/plugins/sparkpost/
20 stars 15 forks source link

Support multisite #99

Open rajumsys opened 7 years ago

rajumsys commented 7 years ago
bobwol commented 7 years ago

I think activating the plugin and setting up an API for the entire network is better than inserting an API for each site on the network.

Or is it possible to have both configurations?

landbryo commented 7 years ago

I'd like the option to be able to set the API key up by adding a line in the wp-config.php or something similar so this can be used with multisite.

johnlund commented 6 years ago

Any updates on this?

wp-networks commented 6 years ago

+1

bobwol commented 6 years ago

Hey, I found a way to handle that:

1) Add in wp-config.php (WordPress config file):

define('SPARKPOST_ENABLE',true); define('SPARKPOST_API_KEY','yourapikey'); // change yourapikey to your Sparkpost API Key define('SPARKPOST_FROM_NAME','Your Name'); // change YourName to your From Name define('SPARKPOST_FROM_EMAIL','email@example.com'); // change email@example.com to your From Email

2) in sparkpost.class.php (plugin file based on v3.2.0), update the method to: protected static $settings_default = array( 'port' => 587, 'sending_method' => 'api', 'password' => SPARKPOST_API_KEY, 'from_name' => SPARKPOST_FROM_NAME, 'from_email' => SPARKPOST_FROM_EMAIL, 'enable_sparkpost' => SPARKPOST_ENABLE, 'enable_tracking' => true, 'template' => '', 'transactional' => false, 'log_emails' => false, 'location' => 'us' );

Caveats:

What do you think?