Developers always ❤️ the freedom of working on open source and why not? - If it's more secure and free. So is our APIs.
Optional Note: This library will be sending HTTP calls to Pepipost server and hence if you're running any firewalls
then please whitelist the API base URL api.pepipost.com with port 443/80
The Code has few Dependencies which we have listed in our composer.json
file which comes with our SDK.
Below Steps will Guide you Step by Step, So that your installation is completed Smoothly.
-
Check PHP version (should be >= 5.4.0)
php -v
or you can install PHP if it is not installed
-
Check composer version
composer --version
or download composer if composer is not installed
-
Open Command prompt/ terminal.
-
make Test Directory or you can directly copy the git clone command below
mkdir test
-
Download SDK
Check whether Git is installed or not
Note :: This is not mandatory you can also download zip of SDK if you don't want to clone we will go by git clone method both methods are described below.
Git method
Clone Pepipost PHP Repo
git clone https://github.com/pepipost/pepipost-sdk-php.git test
Zip method
Download Zip here
Unzip in your new directory named test (mentioned in point no 2).
-
Resolving Dependencies
Change your Directory
cd test
(unzipped or cloned directory).use below to install all dependencies
composer install
-
Running Sample Code.
vim testSDK.php
(open in any editor).Copy and paste Sample Code from simpleUsage file
OR
mv SimpleUsage.md testSDK.php
-
Grab your apiKey and SendingDomain from panel
apikey will be available from login to pepipost -> settings -> integration
Sending Domain will be available from login to pepiost -> settings -> Sending Domains
note :: only Active Domains are allowed
Make neccessary Changes in Script (apikey and Sending Domain -- mandatory changes). Change your $apiKey = 'api-XX-key-XX-here' to $apiKey = 'api-key-from-panel';
Similarly Change your Sending Domain from $body->from->fromEmail = 'admin@myfirsttest.com'; to $body->from->fromEmail = 'admin@your-active-domain-from-panel';
-
Send Your First email using SDK
php testSDK.php
This will give you result as follows