sendgrid / sendgrid-php

The Official Twilio SendGrid PHP API Library
https://sendgrid.com
MIT License
1.49k stars 624 forks source link

Add new marketing API #863

Closed maximepvrt closed 3 years ago

maximepvrt commented 5 years ago

Your new marketing API is out since the 1st July but not implemented on your PHP SDK.

danielpaz92 commented 5 years ago

Waiting for it.

lqchinh88 commented 5 years ago

still nothing ?

bcmcq commented 4 years ago

Any updates on this?

murich commented 4 years ago

@maximepvrt @danielpaz92 @lqchinh88 @bcmcq check this pull request https://github.com/sendgrid/sendgrid-php/pull/32

bcmcq commented 4 years ago

From what I can tell, it's not documented anywhere (https://github.com/sendgrid/sendgrid-php/blob/master/USAGE.md) or officially added to this SDK but because the way it's setup, I did get it working for anyone this may help out..

Some example calls using this lib against the new marketing API:

# All Lists
$sendgrid->client->marketing()->lists()->get();

# Create List
$sendgrid->client->marketing()->lists()->post($data);

# Update List
$sendgrid->client->marketing()->lists($id)->patch($data);

# Add User to List
$sendgrid->client->marketing()->contacts()->put($data);

Reference: https://sendgrid.com/docs/API_Reference/api_v3.html under "New Marketing Campaigns" for data that needs to be passed.

I didn't test them all but I think all calls should work if you set them up in this manner.

Use at your own risk. 😀

MG84 commented 4 years ago

@bcmcq Thanks. I think I will wait to use them in my production... even if testing goes well.

thinkingserious commented 4 years ago

Hello @maximepvrt,

Pull requests to add this feature are welcome and will be reviewed based on priority, but Twilio SendGrid is not actively building new functionality for the library.

That said, @bcmcq's solution is valid.

With best regards,

Elmer

thinkingserious commented 3 years ago

Since there has been no activity on this issue since March 1, 2020, we are closing this issue. Please feel free to reopen or create a new issue if you still require assistance. Thank you!