Download the PHP package amply/amply-php without Composer
On this page you can find all versions of the php package amply/amply-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download amply/amply-php
More information about amply/amply-php
Files in amply/amply-php
Package amply-php
Short Description PHP SDK for Amply
License MIT
Homepage http://github.com/sendamply/amply-php
Informations about the package amply-php
Amply
This is the Amply PHP SDK that integrates with the v1 API.
Table of Contents
- Install
- Quick Start
- Methods
Install
Prerequisites
- PHP 7.0+
- Amply account, sign up here.
Access Token
Obtain your access token from the Amply UI.
Install Package
Add Amply to your composer.json file. If you are not using Composer, we highly recommend it. It's an excellent way to manage dependencies in your PHP application.
Alternative: Install from repo
If you are not using Composer, simply download and checkout the version you want to use from the Github repository.
Domain Verification
Add domains you want to send from
via the Verified Domains tab on your dashboard.
Any emails you attempt to send from an unverified domain will be rejected. Once verified, Amply immediately starts warming up your domain and IP reputation. This warmup process will take approximately one week before maximal deliverability has been reached.
Quick Start
The following is the minimum needed code to send a simple email. Use this example, and modify the to
and from
variables:
Once you execute this code, you should have an email in the inbox of the recipient. You can check the status of your email in the UI from the Search, SQL, or Users page.
Methods
Parameter(s) | Description |
---|---|
to, cc, bcc | Email address of the recipient(s). This may be a string "Test <[email protected]>" , an associative array array('name' => 'Bill', 'email' => '[email protected]') , or a sequential array of strings/associative arrays. |
personalizations | For fine tuned access, you may override the to, cc, and bcc keys and use advanced personalizations. See the API guide here. |
from | Email address of the sender. This may be formatted as a string or associative array with name and email keys. An array of senders is not allowed. |
subject | Subject of the message. |
html | HTML portion of the message. |
text | Text portion of the message. |
content | A sequential array of associative arrays containing the following fields: type (required), value (required). |
template | The template to use. This may be a string (the UUID of the template), a sequential array of UUID strings (useful for A/B/... testing where one is randomly selected), or an associative array of the format array('template1Uuid' => 0.25, 'template2Uuid' => 0.75) (useful for weighted A/B/... testing). |
dynamicTemplateData | The dynamic data to be replaced in your template. This is an associative array of the format array('variable1' => 'replacement1', ...) . Variables should be defined in your template body as ${variable1} . |
replyTo | Email address of who should receive replies. This may be a string or an associative array with name (optional) and email fields. |
headers | An associative array where the header name is the key and header value is the value. |
ipOrPoolUuid | The UUID string of the IP address or IP pool you want to send from. Default is your Global pool. |
unsubscribeGroupUuid | The UUID string of the unsubscribe group you want to associate with this email. |
attachments[] | An array of attachments containting an associative array with fields content , filename , type , disposition , andcontentId . |
ttachments[][content] | A base64 encoded string of your attachment's content (required, string). |
attachments[][type] | The MIME type of your attachment (optional, string). |
attachments[][filename] | The filename of your attachment (required, string). |
attachments[][disposition] | The disposition of your attachment (inline or attachment ) (optional, string). |
attachments[][contentId] | The content ID of your attachment (optional, string). |
clicktracking | Enable or disable clicktracking (bool). |
categories | A sequential array of email category strings you can associate with your message. |
substitutions | An associative array of the format array('subFrom' => 'subTo', ...} of substitutions. |
Example
All versions of amply-php with dependencies
ext-curl Version *