Problem/Motivation

Need to be able to store the api key using the key module (see issue https://www.drupal.org/project/sendgrid_integration/issues/2915575)
Need to be able to use the sendgrid api outside of the specific reports page.
Need to add subusers and bounce reporting.

Steps to reproduce

Try to set use sendgrid_integration_reports with the key stored using the key module, report fails.

Proposed resolution

Attached is a patch which moves the API specific logic out to a separate service, adds the key module logic to that service and adds some other functions for subusers and bounces.

Remaining tasks

Review

User interface changes

None

API changes

Api logic moved to Drupal\sendgrid_integration_reports\Api (sendgrid_integration_reports.api)

Data model changes

None

Comments

lambic created an issue. See original summary.

lambic’s picture

StatusFileSize
new27.65 KB

Missed a return on the 1st patch, so here's another.

perignon’s picture

Have you tried this with the 8.x-2.0 alpha releases?

lambic’s picture

I just confirmed the patch applies to 8.x-2.x, but I don't have the capacity to test with that version currently.

lambic’s picture

StatusFileSize
new27.84 KB

Another new version of the patch to add subuser support to the three stats functions.

lambic’s picture

StatusFileSize
new27.52 KB

Realising now that injecting the key repository won't work for people who don't have the key module, so here's a patch using Drupal::service instead.

  • Perignon committed 3ec5971 on 8.x-1.x authored by lambic
    Issue #3201043 by lambic: Submodule sendgrid_integration_reports needs...

  • Perignon committed 186fb0b on 8.x-2.x authored by lambic
    Issue #3201043 by lambic: Submodule sendgrid_integration_reports needs...
perignon’s picture

Status: Active » Fixed

I put it into both 1.x and 2.x

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

yang_yi_cn’s picture

This patch has a slight problem, which is that it's using

use Drupal\Core\Logger\LoggerChannelFactory;

instead of

use Drupal\Core\Logger\LoggerChannelFactoryInterface;

It will cause issues when you are using other logger modules replacing core logger. I'll create a new ticket.