Read from the package's own PHP files at the commit 1bb02eee83ac: its namespaces, classes, interfaces and enums, their public constants, properties and methods with their PHPDoc, and the options its factories take. Nothing of it is run.
ApiclassWhat the e-mail gateway's actions work with: the mailer, the store, the message's settings.
2 methods · 7 properties
EmailGatewayFactoryclassThe invoice by e-mail: attached to a message to the buyer, sent by the application's mailer, its statuses kept by hand. No platform: legal for a small company's invoices until it must issue through an approved platform (1 September 2027 for SMEs and micro-companies); then the site changes gateway, not code.
10 options · 1 method
InMemoryStatusStoreclassStatuses in this process's memory: for tests, a script, the harness.
2 methods
StatusStoreInterfaceinterfaceWhere the statuses of invoices sent by e-mail are kept - by hand: nobody else tells them. The application's table, usually; InMemoryStatusStore for tests and scripts.
2 methods
FetchStatusActionclassThe invoice's statuses, as the application recorded them.
3 methods
SetStatusActionclassA status recorded by hand: the invoice paid, refused, disputed - nobody else tells it by e-mail. Nothing is sent.
3 methods
SubmitActionclassThe invoice, attached to an e-mail to the buyer's address: once the mailer took it, the invoice is SENT - what happens next, the application records by hand (setStatus).
3 methods
Omnibill\Email
Api class
final class Api Api.php:8
What the e-mail gateway's actions work with: the mailer, the store, the message's settings.
public readonly MailerInterface $mailerpublic readonly StatusStoreInterface $storepublic readonly string $frompublic readonly ?string $replyTopublic readonly array $bccpublic readonly string $subjectpublic readonly string $body
Api::__construct()
public function __construct(public readonly MailerInterface $mailer, public readonly StatusStoreInterface $store, public readonly string $from, public readonly ?string $replyTo = null, public readonly array $bcc = [], public readonly string $subject = 'Facture {number}', public readonly string $body = "Bonjour,\n\nVeuillez trouver ci-joint la facture {number}.\n\nCordialement,\n{seller}")Api::fill()
public function fill(string $template, array $values): stringThe subject or the body with {number}, {seller}, {buyer}, {total}, {currency} filled in.
EmailGatewayFactory class
final class EmailGatewayFactory extends GatewayFactory EmailGatewayFactory.php:33
The invoice by e-mail: attached to a message to the buyer, sent by the application's mailer, its statuses kept by hand. No platform: legal for a small company's invoices until it must issue through an approved platform (1 September 2027 for SMEs and micro-companies); then the site changes gateway, not code.
options: from: 'Atelier <factures@example.org>' # required reply_to: comptabilite@example.org bcc: [archives@example.org] # a copy of each invoice sent subject: 'Facture {number}' # {number}, {seller}, {buyer}, {total}, {currency} body: "Bonjour,\n\nVeuillez trouver ci-joint la facture {number}..."
The factory takes the application's MailerInterface (symfony/mailer, a library) and the StatusStoreInterface statuses are kept in - this process's memory when none is given.
Options
| Option | Default | |
|---|---|---|
reply_to | null | |
bcc | [] | |
subject | 'Facture {number}' | |
body | "Bonjour,\n\nVeuillez trouver ci-joint la facture {number}.\n\nCordialement,\n{seller}" | |
omnibill.capabilities | new Capabilities([Syntax::FACTURX, Syntax::UBL, Syntax::CII], approved: false, publicSector: false) | |
omnibill.api | fn(Config $c) => new Api($this->mailer ?? throw new InvalidConfigException('The "email" gateway needs a mailer: give the factory a Symfony\Component\Mailer\M… | |
omnibill.action.submit | new SubmitAction() | |
omnibill.action.fetch_status | new FetchStatusAction() | |
omnibill.action.set_status | new SetStatusAction() | |
from | required |
EmailGatewayFactory::__construct()
public function __construct(readonly ?MailerInterface $mailer = null, readonly ?StatusStoreInterface $store = null)InMemoryStatusStore class
final class InMemoryStatusStore implements StatusStoreInterface InMemoryStatusStore.php:8
Statuses in this process's memory: for tests, a script, the harness.
InMemoryStatusStore::record()
public function record(string $reference, StatusChange $change): voidInMemoryStatusStore::history()
public function history(string $reference): arrayStatusStoreInterface interface
interface StatusStoreInterface StatusStoreInterface.php:12
Where the statuses of invoices sent by e-mail are kept - by hand: nobody else tells them. The application's table, usually; InMemoryStatusStore for tests and scripts.
StatusStoreInterface::record()
public function record(string $reference, StatusChange $change): voidAdds a status to the invoice's history, under the flow's reference.
StatusStoreInterface::history()
public function history(string $reference): array- Returns
oldest first; empty for an unknown reference
Omnibill\Email\Action
FetchStatusAction class
final class FetchStatusAction implements ActionInterface, ApiAwareInterface FetchStatusAction.php:13
The invoice's statuses, as the application recorded them.
FetchStatusAction::__construct()
public function __construct()FetchStatusAction::supports()
public function supports(Request $request): boolFetchStatusAction::execute()
public function execute(Request $request): voidSetStatusAction class
final class SetStatusAction implements ActionInterface, ApiAwareInterface SetStatusAction.php:18
A status recorded by hand: the invoice paid, refused, disputed - nobody else tells it by e-mail. Nothing is sent.
SetStatusAction::__construct()
public function __construct()SetStatusAction::supports()
public function supports(Request $request): boolSetStatusAction::execute()
public function execute(Request $request): voidSubmitAction class
final class SubmitAction implements ActionInterface, ApiAwareInterface SubmitAction.php:29
The invoice, attached to an e-mail to the buyer's address: once the mailer took it, the invoice is SENT - what happens next, the application records by hand (setStatus).
SubmitAction::__construct()
public function __construct()SubmitAction::supports()
public function supports(Request $request): boolSubmitAction::execute()
public function execute(Request $request): void