Support multisite
rajumsys opened this issue · 5 comments
- Each site can have their own configuration.
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?
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.
Any updates on this?
+1
Hey, I found a way to handle that:
- 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
- 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:
- If you update the plugin, you will lost the changes on sparkpost.class.php, and have to do the step 2 again.
What do you think?