Skip to content

Dynamically change the APIKey  #1210

@sharatchandra99

Description

@sharatchandra99

Hi Team,

I have added the following D.I. in my code,

services.AddSendGrid(options =>
{
options.ApiKey = Environment.GetEnvironmentVariable("SENDGRID_API_KEY");
})

Now I am getting SendGridClient in my service with the APIKey. But I want to change the API key before calling "SendEmailAsync". Can you please suggest any possible way for this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions