Download the PHP package silvershop-suite/newsletter-laposta without Composer

On this page you can find all versions of the php package silvershop-suite/newsletter-laposta. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package newsletter-laposta

silvershop-suite/newsletter-laposta

Laposta ESP adapter for silvershop-suite/newsletter. It implements the core's NewsletterProvider contract with a thin Guzzle client (no heavy official SDK) and maps subscriber changes to the Laposta API v2, plus a webhook back to the local list.

The core owns capture, consent and double opt-in; this adapter just syncs confirmed subscribers to a Laposta list and keeps the local status in step via webhooks. Laposta is a Dutch ESP, so it fits the suite's NL-first lean.

Requirements

silvershop-suite/newsletter hard-requires symbiote/silverstripe-queuedjobs, so the queued sync runner comes in transitively.

Installation

silvershop-suite/newsletter is an RVXD module (not published to Packagist), so it is resolved from a composer repositories entry. The shipped composer.json uses the VCS form:

Then:

(A private newsletter repo needs a GitHub token with repo scope, e.g. composer config -g github-oauth.github.com <token>.)

Local development (core not yet pushed)

When you are developing both modules side by side and silvershop-suite/newsletter isn't published yet, point the adapter at your local checkout with a path repository instead of (or in addition to) the VCS entry — this is how the dev site and the standalone clean-room resolve it:

Configuration

Credentials come from the environment (.env):

Authentication is HTTP Basic with the API key as the username and an empty password (the curl -u KEY: form). SS_LAPOSTA_LIST_ID is the target list's id.

Then make Laposta the active provider:

Laposta has no native first/last-name fields — everything is a custom field. Map the subscription's merge fields onto your list's custom fields by their custom_name (the fields must already exist on the list):

The required ip

Laposta requires an ip on member-create (its registration IP, for anti-spam / opt-in audit). The sync runs inside a queued job with no originating web request, so there is no real subscriber IP at push time. The adapter therefore sends a configurable placeholder (default 0.0.0.0); set your server IP if you prefer:

With single opt-in (the default, see below) Laposta does not run its public-signup spam check, so a placeholder IP is expected to be accepted. Verify against a live Laposta list that 0.0.0.0 is accepted for API-originated signups; if not, set default_ip to a real (server) IP. A cleaner long-term fix is to capture the real signup IP in silvershop-suite/newsletter core and have this adapter prefer it — tracked as a coordinated follow-up.

API host

The adapter talks to https://api.laposta.nl/v2/ by default. The Laposta docs show both api.laposta.nl and api.laposta.org; the official PHP SDK uses .nl. Override only for a sandbox:

Configure the Laposta list as SINGLE opt-in. The core already performs double opt-in (it emails the subscriber a confirm link and only syncs them once confirmed). The adapter therefore sends options[ignore_doubleoptin]=true so Laposta activates the member immediately and sends no second confirmation email. If the list is also set to double opt-in, subscribers could receive a redundant confirmation. If you would rather Laposta run the confirmed-opt-in step itself, set double_opt_in: true and the adapter omits ignore_doubleoptin:

How it maps

Operation Laposta API v2
subscribe / update POST member with options[upsert]=true (idempotent add-or-update)
unsubscribe POST member/{email} with state=unsubscribed (soft — keeps the record, not a DELETE)
full resync (sake tasks:NewsletterResync --run) upsert for every locally-subscribed record

Member bodies are form-encoded (application/x-www-form-urlencoded), not JSON — nested parameters use PHP array-bracket syntax (custom_fields[voornaam]=…, options[upsert]=true). The member is addressed by its email address in the unsubscribe URL (no hash).

Webhook (Laposta → local)

Register one webhook per event (subscribed, modified, deactivated) pointing at:

A webhook is created with POST /v2/webhook (list_id, event, url, blocked=false); the response includes a per-webhook secret — that is SS_LAPOSTA_WEBHOOK_SECRET.

Real HMAC signature verification. Unlike the Mailchimp / Campaign Monitor adapters (which only compare a shared secret), Laposta signs every webhook with HMAC-SHA256 of the raw request body, keyed with the webhook's secret, delivered as the header X-Laposta-Signature: sha256=<hex>. The adapter recomputes the HMAC over the raw body and constant-time compares it. If SS_LAPOSTA_WEBHOOK_SECRET is unset, the webhook is accepted without a signature (it only ever changes status for emails already on the local list).

Laposta posts a JSON batch — { "date_requested": …, "data": [ { "event": …, "data": { … }, "info": … }, … ] }. The core's webhook controller calls this adapter's verifyWebhook() + parseWebhook(), which map each event's member state (and finer info.action) to the local status:

Laposta signal Local status
event: subscribed / modified, member state: active Subscribed
event: deactivated, info.action: unsubscribed / state: unsubscribed Unsubscribed
info.action: hardbounce Bounced
member state: cleaned Cleaned
info.action: deleted Unsubscribed

Assumptions to verify against a live Laposta delivery

This v1 was built from the published API docs without a live sandbox account. The following defaults are applied and made configurable; confirm them against a real Laposta list + webhook delivery, and adjust if needed:

Development

License

BSD-3-Clause.

Credits

Built and maintained by Remy Vaartjes ([email protected]) — part of the SilverShop-Suite.


All versions of newsletter-laposta with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
silverstripe/framework Version ^6
silverstripe/cms Version ^6
silvershop-suite/newsletter Version dev-main
guzzlehttp/guzzle Version ^7
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package silvershop-suite/newsletter-laposta contains the following files

Loading the files please wait ...