Email driver initialisation failed: SendGridEmailBackend requires a configuration map

I get the following log message in the dashboard when trying to setup Sendgrid:

time="Jan 19 12:26:04" level=error msg="Email driver initialisation failed: SendGridEmailBackend requires a configuration map"

Note that I have the following env-var (hiding in a secret in a Kubernetes Cluster):

TYK_DB_EMAILBACKEND_SETTINGS={"ClientKey": "SG.Pr0p3rS3ndGr1dT0k3n"}

and the following (relevant) tyk_analytics.conf:

        "email_backend": {
          "enable_email_notifications": true,
          "code": "sendgrid",
          "default_from_email": "[email protected]",
          "default_from_name": "Me"
        },

Am I supposed to escape it some other way when using the Env-var setting way?

It would be:

TYK_DB_EMAILBACKEND_SETTINGS="ClientKey:SG.Pr0p3rS3ndGr1dT0k3n3"

At least I think that should work… that full stop may cause an issue

TYK_DB_EMAILBACKEND_SETTINGS="ClientKey:SG.Pr0p3rS3ndGr1dT0k3n3"

I did not get this to work, still the same error message. So I do not know if the syntax still is faulty or if it is just the . in the value.

Follow up question: How do I supply config in the pumps as ENV-vars?
They are json objects with multiple levels i.e:

{
  "mongo": {
    "name": "mongo",
    "meta": {
      "collection_name": "tyk_analytics",
      "mongo_url": "mongodb://myUser:myPassword@mongodb:27017/tyk_analytics"
    }
  }
}

@Martin Any updates on this, because I can not get it to work with your instructions mentioned above?

Each of the pumps has their own environment variable prefix to set the options (and for the aggregate mongo pump, also required), so for the example you cite you would use:

PMP_MONGO_MONGOURL=mongodb://myUser:myPassword@mongodb:27017/tyk_analytics

You can leave the rest as defaults

Thank you very much, this worked nicely for the pumps.