- Adds
oneClickUnsubscribeURL
parameter tosendEmail
- Removes the
is_csv
parameter fromprepareUpload
- Adds a
filename
parameter toprepareUpload
to set the filename of a document when it is downloaded. See the documentation for more information.
- Removed guzzle5-adapter and guzzle6-adapter documentation and support; this version now supports any PSR-7 compatible client library. Our documentation provides examples for using guzzle7.
- Add support for new security features when sending a file by email:
confirm_email_before_download
can be set totrue
to require the user to enter their email address before accessing the file.retention_period
can be set to<1-78> weeks
to set how long the file should be made available.
- Added PHP 8 to supported PHP versions in
composer.json
. Support for PHP >7.1 is maintained. No code changes or updates to non-dev dependencies are required.
- Updated dev dependencies:
- Updated
phpspec/phpspec
to ^7.2 (^5.0 permitted for PHP 7.1 users) - Updated
php-http/socket-client
to ^2.1.0
- Updated
See #115 for further context
- Added explicit requirement for PHP versions < 7.1 to composer.json
See #107 for further context
- Removed support for PHP versions < 7.1
- Bumped firebase/php-jwt from ^5.0.0 to ^v6.1.0 to bring in security patches
See #107 for further context
- Added
letter_contact_block
to the responses forgetTemplate
,getTemplateVersion
andlistTemplates
.
- Add support for an optional
is_csv
parameter in theprepareUpload()
function. This fixes a bug when sending a CSV file by email. This ensures that the file is downloaded as a CSV rather than a TXT file.
- Bumped firebase/php-jwt from 3.0.0 to 5.0.0 to bring in latest bugfixes and features
- Dropped support for ^1.0 releases of HTTPlug (phphttp/httplug)
- HTTP clients may now use the
Psr\Http\Client\ClientInterface
(found in ^2.0 releases of HTTPlug) rather thanHttp\Client\HttpClient
interface (found in ^1.0 releases of HTTPlug).
- HTTP clients may now use the
- Refer to files, not documents in error messages.
- Add new method
getPdfForLetter
- requires $notificationId, returns a string with the pdf data for that letter
- Dropped official support for PHP versions older than 7.1.
- Removed unused dependencies from
composer.json
- Added a way to set postage when sending precompiled letters:
- set (optional)
$postage
argument onsendPrecompiledLetter
- set (optional)
- Added support for httplug 2.0
- Added support for document uploads in sendEmailNotification.
- Call
$this->prepareUpload
, and add the return value to your$personalisation
array.
- Call
- The client can now send PDF files which conform to the Notify printing template
- call the
SendLetterResponse sendLetter( $reference, $pdf_data )
function $reference
must be provided to identify the document$pdf_data
is a string, as returned fromfile_get_contents
for example
- call the
- Moved dependency on client to require-dev -
php-http/guzzle6-adapter
- Removed versions from
composer.json
to make it easier to install for users.
- Added
$this->listReceivedTexts()
- an optional
older_than
argument can be specified to retrieve the next 250 received text messages older than the given received text id. If omitted 250 of the most recent received text messages are returned.
- an optional
- sendLetter added to Client.php
SendLetterResponse sendLetter( $templateId, array $personalisation = array(), $reference = '' )
- personalisation map is required, and must contain the recipient's address details.
- as with sms and email, reference is optional.
- Update to
$this->sendSms()
- added
smsSenderId
: an optional sms_sender_id specified when adding SMS senders under service settings. If this is not provided, the SMS sender will be the service default SMS sender.smsSenderId
can be omitted.
- added
- Update to
Alphagov\Notifications\Exception\ApiException
- added two new methods- added
getErrors()
to retrieve the original errors array from the json response. - added
getErrorMessage()
to retrieve a nicely formatted message
- added
- Update to
$this->sendEmail()
- added
emailReplyToId
: an optional email_reply_to_id specified when adding Email reply to addresses under service settings, if this is not provided the reply to email will be the service default reply to email.emailReplyToId
can be omitted.
- added
- Added new methods for managing templates:
$this->getTemplate
- retrieve a single template$this->getTemplateVersion
- retrieve a specific version for a desired template$this->listTemplates
- retrieve all templates (can filter by type)$this->previewTemplate
- preview a template with personalisation applied
-
Using v2 of the notification-api.
-
Update to
$this->sendSms()
:- Added
reference
: an optional identifier you generate if you don’t want to use Notify’sid
. It can be used to identify a single notification or a batch of notifications. - Updated method signature:
- Added
public function sendSms( $phoneNumber, $templateId, array $personalisation = array(), $reference = '' )
* Where `$personalisation` and `$reference` can be omitted.
- Update to
$this->sendEmail()
:- Added
reference
: an optional identifier you generate if you don’t want to use Notify’sid
. It can be used to identify a single notification or a batch of notifications. - Updated method signature:
- Added
public function sendEmail( $emailAddress, $templateId, array $personalisation = array(), $reference = '' )
* Where `$personalisation` and `$reference` can be omitted.
- Updated
$this->listNotifications()
- Notifications can now be filtered by
reference
andolder_than
, see the README for details.
- Notifications can now be filtered by
Changelog not recorded - please see pull requests on github.