https://github.com/settermjd/sendgrid-import-retrieve-with-php
This is a small project to support an upcoming tutorial on the SendGrid blog, that shows how to import a contact into a SendGrid account, and to then retrieve that contact's details, after it's been successfully imported.
https://github.com/settermjd/sendgrid-import-retrieve-with-php
Last synced: 11 months ago
JSON representation
This is a small project to support an upcoming tutorial on the SendGrid blog, that shows how to import a contact into a SendGrid account, and to then retrieve that contact's details, after it's been successfully imported.
- Host: GitHub
- URL: https://github.com/settermjd/sendgrid-import-retrieve-with-php
- Owner: settermjd
- License: other
- Created: 2023-03-10T13:52:21.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-03-10T14:00:08.000Z (over 3 years ago)
- Last Synced: 2025-03-13T03:16:09.001Z (over 1 year ago)
- Language: PHP
- Size: 5.86 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Show how to import and retrieve a contact with SendGrid's API
This is a small project to support an upcoming tutorial on the SendGrid blog, that shows how to import a contact into a SendGrid account, and to then retrieve that contact's details, after it's been successfully imported.
## Usage
To use the project, first clone it locally, change into the newly created project directory, and install PHP's dependencies, by running the following commands.
```bash
git clone git@github.com:settermjd/sendgrid-import-retrieve-with-php.git
cd sendgrid-import-retrieve-with-php
composer update
```
After Composer installs PHP's dependencies, it creates a new _.env_ file, where the application's environment variables are stored.
There's only one, `SENDGRID_API_KEY`.
You need to set this to your SendGrid API key.
To create one, open https://app.sendgrid.com/settings/api_keys in your preferred browser, click **Create API Key**, and follow the prompts.
More information is available [in the documentation](https://docs.sendgrid.com/ui/account-and-settings/api-keys).
A concise guide will be available in the tutorial, when it's available.
After setting your SendGrid API key, in the terminal, in the top-level directory of the project, run the following commands:
```bash
# Import a contact
php import-contact.php
# Retrieve the contact's details, if it has been successfully imported.
php retrieve-contact.php
```