メインコンテンツにスキップ

Send email with SendGrid

This guide explains how to send the emails of Casdoor through the API of SendGrid.


Learning outcomes​

  • Create a SendGrid API key and verify a sender.
  • Add SendGrid as an email provider in Casdoor and test it.

What you need​

  • A SendGrid account
  • Administrator access to the Casdoor admin console

Prepare SendGrid​

  1. In the SendGrid dashboard, go to Settings > API Keys, click Create API Key, and select the permissions that you need. Copy the key.

    API key creation in SendGrid

  2. Verify your sender with Single Sender Verification or Domain Authentication. See Sender Identity.

Add the provider in Casdoor​

  1. In the Casdoor admin console, go to Identity > Providers and add a provider.

  2. Set Category to Email and Type to SendGrid.

  3. Fill in the required fields:

    フィールド説明
    シークレットキーYour SendGrid API key
    差出人アドレスVerified sender email or domain
  4. Optionally, change the defaults:

    フィールドデフォルト
    エンドポイント/v3/mail/send
    ホストhttps://api.sendgrid.com
  5. Optionally, fill in the remaining fields:

    フィールド説明
    From NameSender display name
    メールタイトル件名
    Email contentBody (HTML supported)
    テストメールRecipient for Send Testing Email

    SendGrid provider in Casdoor

  6. Save the provider.

Verify the result​

Click Send Testing Email and check that the message arrives at the Test Email address.

See also​