Now that this module uses Key for managing the API key, the documentation needs to be updated to explain what kind of key is expected and how to create it.

The README still says "Configure your SendGrid API-Key in admin/config/services/sendgrid" which is incorrect if Key module is enabled.

Comments

AaronBauman created an issue. See original summary.

damienmckenna’s picture

Here's what I've done:
* Go to: /admin/config/system/keys
* Click on "Add Key".
* Fill in a "Key name" eg "Sendgrid API key".
* Set the key type to "Authentication".
* Set the key provider to "Configuration".
* Paste the API key into the "Key value" field.
* Click "Save".
* Back in the Sendgrid admin page, select the new key as the "API secret key".

Disclaimer: I haven't finished setting it up, but this seems like the right direction.

damienmckenna’s picture

I finished setting this up last night and the steps above worked.

damienmckenna’s picture

Assigned: Unassigned » damienmckenna

I'll put this together as a formal docs update.

damienmckenna’s picture

Status: Active » Needs review
StatusFileSize
new4.14 KB

Here are the steps I used to make it work.

aaronbauman’s picture

Status: Needs review » Needs work

Thanks for the writeup, looks pretty good.

My only bit of feedback is that Key module is optional, so the "Create a key definition using the Key module" step depends on whether that module is enabled.

Otherwise, the admin/config/services/sendgrid settings are still applicable.

See SendGridSettingsForm

    $key_exists = $this->moduleHandler->moduleExists('key');

    if ($key_exists) {
      $form['authentication']['sendgrid_integration_apikey'] = [
        '#type' => 'key_select',
        '#required' => TRUE,
        '#default_value' => $config->get('apikey'),
        '#title' => $this->t('API Secret Key'),
        '#description' => $this->t('The secret key of your key pair. These are only generated once by Sendgrid.'),
      ];
    }
    else {
      $form['authentication']['sendgrid_integration_apikey'] = [
        '#type' => 'password',
        '#required' => $requirenewkey,
        '#title' => $this->t('API Secret Key'),
        '#description' => $this->t('The secret key of your key pair. These are only generated once by Sendgrid. Your existing key is hidden. If you need to change this, provide a new key here.'),
      ];
    }

damienmckenna’s picture

You know, I never noticed that, because I already had the Key module installed for something else X-)

damienmckenna’s picture

Assigned: damienmckenna » Unassigned
Status: Needs work » Needs review
StatusFileSize
new8.42 KB
new7.38 KB

How about this? I split up the installation into two pieces, depending upon whether the Key module is used.

aaronbauman’s picture

Status: Needs review » Reviewed & tested by the community

Makes sense to me, thanks!

perignon’s picture

I'll get this merged in as soon as I can.

perignon’s picture

Status: Reviewed & tested by the community » Fixed

Done! Thanks for the help!

Status: Fixed » Closed (fixed)

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