Thread Starter
Valice
(@valicesupport)
Forgot to add to this that the API key won’t activate though until the stats permissions are added. It throws the “Invalid API key entered. message.” Ideally it could be activated without those as it works when they are removed just only after it’s been activated in the plugin interface.
Hi, thanks for the feedback. We have a new version of the plugin we are testing which will only show the stats tab in the plugin admin if the permission is turned on for the API key. It also won’t check the permission is enabled when adding or editing the api key
For now what you are doing is good, thanks again for the feedback
Thread Starter
Valice
(@valicesupport)
Hi Mark –
Thanks for the response and update. FYI, we did more digging and it appears that the reason the stats doesn’t work though, is… at some point you added logic to encrypt the key before storing it, but they weren’t/aren’t decrypting the key to grab the username.
Before –
if ($client->consume(new Service('stats/email_summary', ['username' => substr($apiKey, 0, 16)])))
…was/is taking the encrypted key and grabbing the first 16 digits of that, which isn’t a valid username
After –
$decryptKey = $apiKeyHelper->decryptKey($apiKey);
if ($client->consume(new Service('stats/email_summary', ['username' => substr($decryptKey, 0, 16)])))
…and returns the proper email stats for the specific API key
Thanks Valice – really appreciated your feedback. We were half unaware of the issue in the stats tab, as it was sorted in the work we are currently testing for the next version of the plugin (we are testing which will only show the stats tab in the plugin admin if the permission is turned on for the API key)
Is the stats tab useful for you / on your sites? Currently evaluating if we keep it in the plugin, or if we direct people the the SMTP2GO dashboard to look it up
Thread Starter
Valice
(@valicesupport)
Hi Mark –
Thanks for the prompt response. I think that yes, it is useful in some cases to see the bounces and delivery stats within WP instead of having to login to SMTP2Go (in some cases we don’t setup users in sub accounts for instance) but yeah only if we pass the permission in the key settings.
So sounds like we’re in alignment so looking forward to the updates!
Thank you again for the feedback, we are aiming to get the update out in a week or two. Appreciate you using our plugin and service