Search code examples
c#apisendgrid

How to send mails to a segment of a list using New Campaign API (Sendgrid C#)?


Does anyone know how to send mail to a segment of a contact list with Sendgrid New (V3) Campaign API?

The guide only contains the legacy Marketing Campaigns, which doesn't work for the latest SendGrid (v3).

https://docs.sendgrid.com/api-reference/campaigns-api/create-a-campaign

Do I use the single-send instead (no campaign API for V3)? https://docs.sendgrid.com/api-reference/single-sends/create-single-send

Update: I tried to create singlesend to send out email: https://docs.sendgrid.com/api-reference/single-sends/create-single-send

But it always create a DRAFT that appears in my sendgrid dashboard, without actually sending it out. I then tried Schedule SingleSend https://docs.sendgrid.com/api-reference/single-sends/schedule-single-send

It works now. So in summary I need to create SingleSend, and then schedule the singlesend (from its ID) with a datetime.


Solution

  • Twilio SendGrid developer evangelist here.

    Single-sends are the equivalent of the Campaign API for legacy marketing campaigns. You can send a mail to a segment with a single-send with the following JSON data structure:

    { 
      "name": "Single send name",
      "send_to": {
        "segment_ids": ["ENTER_SEGMENT_ID_HERE"]
      }
    }