# How to configure Twilio SendGrid for sending marketing emails through B2CORE

The instructions below describe how to set up [Twilio SendGrid](https://sendgrid.com/) and connect it to B2CORE so you can send marketing emails to your clients through the B2CORE Back Office.

{% hint style="info" %}
If you want to manage email delivery and marketing campaigns directly through SendGrid and sync client data from B2CORE to SendGrid contacts for this purpose, refer to [How to integrate Twilio SendGrid](https://docs.b2core.b2broker.com/how-to-articles/manage-communication-platforms/how-to-configure-twilio).
{% endhint %}

To set up SendGrid for email delivery through the B2CORE Back Office, follow the steps below:

**First**, register on the SendGrid platform to get API keys.

{% stepper %}
{% step %}
Go to [SendGrid website](https://login.sendgrid.com/login/) and register in the system.
{% endstep %}

{% step %}
After registration, navigate to **Settings** > **API Keys**.
{% endstep %}

{% step %}
Click **Create API Key**.
{% endstep %}

{% step %}
Click the generated API key and make sure the **Full Access** option is checked.
{% endstep %}

{% step %}
Copy the API key.
{% endstep %}
{% endstepper %}

**Then**, configure SendGrid in the B2CORE Back Office.

{% stepper %}
{% step %}
Navigate to **Mailing** > **Configuration**.
{% endstep %}

{% step %}
Click **Create**.
{% endstep %}

{% step %}
Fill out the form:

* **Caption** — enter the name that you want to use for the SendGrid configuration.
* **Platform** — select **SendGrid** from the drop-down list.
  {% endstep %}

{% step %}
Click **Save**.
{% endstep %}

{% step %}
Paste the copied API key to the **API key** field.
{% endstep %}

{% step %}
Enter **Sender address** and **Sender name**.
{% endstep %}

{% step %}
Switch **Status** to **enabled**.
{% endstep %}

{% step %}
Click **Save**.
{% endstep %}
{% endstepper %}

**Finally**, set up a webhook on the SendGrid platform.

{% stepper %}
{% step %}
Go to [SendGrid website](https://login.sendgrid.com/login/).
{% endstep %}

{% step %}
Navigate to **Settings** > **Mail settings**.
{% endstep %}

{% step %}
In the **Event Settings** section, switch the **Status** option to **enabled**.
{% endstep %}

{% step %}
Click **Event Webhook** and fill out the form:

* **Authorization Method** — select **None**.
* **Host URL** — enter the URL specified in the **Webhook URL** field in the **Mailing** > **Configuration** section of the B2CORE Back Office.
* **Deliverability Data** — check all the available checkboxes.
* **Event Webhook Status** — must be switched to **enabled.**
  {% endstep %}

{% step %}
Click **Save**.
{% endstep %}
{% endstepper %}
