• Resolved Valice

    (@valicesupport)


    So we were having issues getting the plugin to work and then read that the two “stats” API permissions are required for the stats tab to work.

    But so for one, the stats page doesn’t really actually work because it says zero messages have been sent (and test messages have in fact been sent). And then it also says “out of 2,000” because that’s the limit of the subaccount the API key is running under as the key is not allowed for 2,000. So it could be reporting emails that aren’t related to the website/plugin it’s installed on at all if for instance, the sub account has another API for another application using SMTP2Go to send emails.

    We disabled those two permissions and now the stats tab just comes back with a message about not being able to retrieve stats. And emails appear to still be getting sent so that is what we’ll do in the meantime.

    Ideally, we could enable the permissions and the stats would be based on API key and not the sub-account it’s tied to. Is that something you could look at fixing and/or is there a reason it’s not already configured that way?

Viewing 6 replies - 1 through 6 (of 6 total)
  • 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.

    Plugin Author Mark Collister

    (@2050nz)

    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

    Plugin Author Mark Collister

    (@2050nz)

    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!

    Plugin Author Mark Collister

    (@2050nz)

    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

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Stats Tab and Permissions’ is closed to new replies.