Download the PHP package polaris/messaging without Composer

On this page you can find all versions of the php package polaris/messaging. 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 messaging

polaris/messaging

Messaging for Polaris for PHP: the verification, reset, invitation, one-time-code and security messages rendered from templates you can override per instance and per organization, translated (en, es, de, fr, pt bundled), rate-limited per recipient, sent through the channel you choose (Symfony Mailer, PHPMailer, Twilio, Vonage, a log, an array in tests), every send recorded in the audit store without its body.

polaris/audit is required and registered too: every delivery is a messaging.sent event. In Laravel, Symfony and Yii the instance goes in the adapter's plugins configuration with the adapter's mailer and sms left unset (log), so the plugin takes over both ports.

How it reaches core

Core sends through two ports, OtpMailerInterface and SmsSenderInterface. When the configuration leaves them unset, the graph takes a plugin's implementation: this plugin's Bridge\Mailer renders core's templates (verify_email, password_reset, org_invite, otp_code, account_locked, password_changed, mfa_enrolled, mfa_factor_removed, recovery_codes_regenerated, recovery_code_used) from the keys below and sends them as email; Bridge\Sms sends core's code message as sms.otp. A host that keeps its own mailer keeps it; the plugin's Sender is still there for the application's own messages:

Templates and translations

Keys: email.verify, email.reset_password, email.magic_link, email.otp, email.invite, email.new_device, email.password_changed, email.account_locked, email.mfa_enrolled, email.mfa_factor_removed, email.recovery_codes_regenerated, email.recovery_code_used, sms.otp, sms.new_device. Each is a subject (email), a text and an optional HTML with {placeholders} ({token}, {code}, {ttl}, {link}, {ip}, {user_agent}, {method}, {remaining}), escaped in the HTML. Resolution: the organization's override (polaris_messaging_template, written with Templates::set()), then the instance's (templates:), then the bundled strings of the locale, then of the default locale. Strings come from a Translator: the bundled ArrayTranslator (resources/translations) takes the host's additions (strings:), or the host plugs its own.

Policy and channels

MessagePolicy: a cap per recipient and template (or kind, or *) through core's rate store; a fallback kind (sms → email) used when no channel of the first kind delivered and the send named an alternative recipient; quiet mode through a Suppressor (the one passed to the plugin, or the one another package provides through its services, as polaris/sentinel does) that drops non-essential messages. Channels are tried in order for the message's kind; a channel throws DeliveryException and the next is tried; a refused or undelivered message is logged and never breaks the operation that asked for it. polaris messaging:send <to> <template> --vars='{"code":"123456"}' checks a channel from the console.

Sending from a queue

Outbox is where a send goes once the policy allowed it. SyncOutbox, the default, delivers on the request. To take sends off the request path, pass your own: it receives data (the Message, scalars and arrays only, and the alternative recipients of its fallback), puts it on your queue and answers Receipt::queued(); the worker hands the same data to Sender::dispatch(), which delivers through the channels and the fallback without asking the policy again or coming back to the outbox:

A queued send has no channel receipt at request time: Sender::send() answers the queued receipt ($receipt->queued is true), null only when the policy refused the send or no channel delivered it. The messaging.sent audit record is written by the worker, when a channel takes the message.

License

MIT. Polaris for PHP is created and maintained by 2am.tech.


All versions of messaging with dependencies

PHP Build Version
Package Version
Requires php Version >=8.3
polaris/audit Version ^0.12
polaris/cli Version ^0.12
polaris/core Version ^0.12
psr/clock Version ^1.0
psr/http-client Version ^1.0
psr/http-factory Version ^1.0
psr/http-message Version ^1.1 || ^2.0
psr/log Version ^3.0
symfony/console Version ^7.0 || ^8.0
symfony/uid Version ^7.0 || ^8.0
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 polaris/messaging contains the following files

Loading the files please wait ...