sendgrid-ruby icon indicating copy to clipboard operation
sendgrid-ruby copied to clipboard

Delete Recipient without id

Open maxsieben opened this issue 10 years ago • 2 comments

I want to ask if it's possible to delete an existing recipient, without using the id.

I found this example: https://github.com/sendgrid/sendgrid-ruby/blob/master/examples/contactdb/contactdb.rb#L213

However it doesn't say, which attributes for data are required when calling: sg.client.contactdb.recipients.delete(request_body: data) .

Is it possible to delete an recipient by passing in an email address or do I need to pass the recipients id in the data object?

maxsieben avatar Jul 26 '16 13:07 maxsieben

You need to pass the recipient ID, please see: https://sendgrid.com/docs/API_Reference/Web_API_v3/Marketing_Campaigns/contactdb.html#Delete-Recipient-DELETE

You did find a bug though, the example is incomplete and I'll leave this ticket open until we fix it.

thinkingserious avatar Jul 26 '16 15:07 thinkingserious

Fixed: https://github.com/sendgrid/sendgrid-ruby/releases/tag/v4.0.2

Thanks again!

thinkingserious avatar Jul 26 '16 16:07 thinkingserious