Open rajumsys opened 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?
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:
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?