Search by

studio-variable / kirby-applications

isUnknown

Secure application forms for Kirby (jobs, calls, residencies…): submissions stored as Panel pages, email notifications, and a Panel area to sort, search, filter and review them

Package info

forge.studio-variable.com/studio-variable/kirby-applications.git

Homepage

Issues

Type:kirby-plugin

pkg:composer/studio-variable/kirby-applications

Statistics

Installs: 29

Dependents: 0

Suggesters: 0

v0.7.0 2026-12-03 12:57 UTC

This package is auto-updated.

Last update: 2026-12-03 14:27:20 UTC


README

Secure application forms for Kirby (jobs, calls, residencies…): each application is stored as a Panel page with its documents, the team is notified by email, and an applications blueprint section lists them to sort, search, filter and review.

The applications section in a page of the Panel

Requirements • Installation • Usage • Panel section • Menu badge • Security • Storage • Email • Configuration • Translations • License

Requirements

  • Kirby 5
  • PHP 8.2+

Installation

Composer (recommended)

composer require studio-variable/kirby-applications

Manual installation

Download the repository and copy it to site/plugins/applications.

Usage

Any form on a page can become an application form: post it to the page itself, with field names matching the fields and files options, and render the applications/fields snippet inside it. The application is attached to the page the form is on (a job listing, a spontaneous application page…).

<?php $form = $page->applicationForm() ?>

<?php if ($form['success']): ?>
    <p role="status"><?= t('studio-variable.applications.success') ?></p>
<?php elseif (isset($form['errors'][$form['formError']])): ?>
    <p role="alert"><?= esc($form['errors'][$form['formError']]) ?></p>
<?php endif ?>

<form method="post" enctype="multipart/form-data">
    <?php snippet('applications/fields', ['form' => $form, 'anchor' => 'form']) ?>

    <input name="firstname" value="<?= esc($form['old']['firstname'] ?? '', 'attr') ?>" required>
    <?php if (isset($form['errors']['firstname'])): ?>
        <p><?= esc($form['errors']['firstname']) ?></p>
    <?php endif ?>

    <!-- lastname, email, phone, message… -->

    <input type="file" name="cv" accept=".pdf,application/pdf" required>
    <input type="file" name="letter" accept=".pdf,application/pdf">

    <button type="submit">Apply</button>
</form>

$page->applicationForm() returns the state of the last submission on this page, read once from the session:

KeyDescription
successtrue after a successful submission
errorsError messages, by field name; the general message is under $form['formError']
oldSubmitted values, to fill the form again after an error (files excluded)

The anchor passed to the snippet is the fragment the visitor is sent back to after submitting (#form here), so they land on the messages rather than at the top of the page.

Panel section

Add a section of type applications to any blueprint. Like a pages section, it lists the subpages of its page with the application template, and parent points it to another page with a Kirby query. Applications are stored in a draft page (see Storage), returned by site.applicationsInbox (which creates it if no application has been sent yet), so a section placed elsewhere, for example in a tab of the page that lists your offers, points there:

tabs:
  applications:
    label: Applications
    icon: email
    sections:
      applications:
        type: applications
        label: Received applications
        parent: site.applicationsInbox
        columns:
          - field: title
          - field: email
          - label: Listing
            field: listing
          - field: submitted
          - field: state
          - field: comment
            width: 1/4

The table:

  • Click a column header to sort by it, click again to reverse the order. Applications are listed from the most recent by default.
  • Search across every column (accents ignored). Status and listing columns add a filter.
  • With a status column, change the status (Pending, Accepted, Rejected) directly from the table.
  • Each row has an options menu to open the application, write to the candidate or delete the application (after confirmation, with its documents).
OptionTypeDefaultDescription
labelstring\|arrayApplicationsHeading of the section
parentstringthe current pageQuery to the page whose application subpages are listed
listingstring—Query to a page: only applications sent from it are listed, for example listing: page in the blueprint of a job offer
columnsarraytitle, email, submittedColumns of the table, see below
limitint50Applications per screen

Columns

Each column points to a field of the application page. List them in order, each with a field and optionally a label, a width (a fraction, like 1/4) and a type. The keyed form of a structure field's columns works too:

columns:
  title: true
  email: true
  listing:
    label: Listing

Available fields: title (the candidate's name), every key of the fields and files options, listing (the page the form was sent from), submitted, state and comment. The options menu is always the last column.

How a value is shown depends on the type of its field, unless type is set:

TypeFieldsShown as
titletitleLink to the application
emailemail fieldsmailto: link
teltel fieldstel: link
datesubmittedDate and time, sorted chronologically
pageslistingTitle of the page, with a filter
statestateStatus button to change it, with a filter
textareatextarea fields, commentExcerpt, full text on hover
filekeys of files“Open” link to the PDF, in a new tab
textother fieldsPlain text

Menu badge

A Panel menu entry can show how many applications have a given status, pending by default. With a custom panel.menu option, add an entry that links to the tab holding the section:

'applications' => [
    'icon'  => 'email',
    'label' => 'Applications',
    'link'  => 'pages/jobs?tab=applications',
    'menu'  => fn (): array => ['badge' => site()->applicationsBadge('pending')],
],

The badge disappears when the count is zero, and the section keeps it up to date when a status is changed or an application is deleted, without reloading the page.

Site methods

MethodReturns
site()->applicationsInbox()The draft page holding applications, created if needed
site()->applicationsCount(string\|null $state = null)Number of applications, all or with the given status (pending, accepted, rejected)
site()->applicationsBadge(string $state = 'pending')A Panel menu badge with that count, or null when it is zero

Application pages

Each application is a page: the candidate's answers are shown read-only, with links to their documents, next to the status and a comment field for the team (for example “Interview scheduled on…”). Their parent page, reached through the breadcrumb, shows every application with all columns.

An application in the Panel

Security

  • Signed token: the form carries a token signed with a secret, binding it to its page and to the time it was displayed. A forged or altered token is rejected.
  • CSRF: Kirby's CSRF token is checked.
  • Bots: a hidden honeypot field, and a minimum delay between displaying the form and sending it. Bots get a success message, nothing is stored.
  • Expiry: a form older than maxAge must be sent again.
  • Rate limit: at most rateLimit applications per rateWindow seconds from the same IP address (stored hashed in the plugin cache).
  • Validation: required fields, maximum lengths, email and phone formats; control characters and line breaks are stripped from single-line fields, which also rules out header injection in emails.
  • Files: PDF only, checked by MIME type and by the file signature, not by the name or the type sent by the browser; size limited by maxFileSize; renamed to cv.pdf, letter.pdf.
  • Output: every value is escaped in the Panel, in emails and when the form is shown again.

The secret is generated on first use and kept in Kirby's cache folder (studio-variable-applications.secret). Set the secret option to manage it yourself.

Storage

Applications are draft pages, children of a draft page (content/_drafts/applications-inbox by default). Drafts are never public: they are left out of the site, its menus, search and sitemap, and only logged-in Panel users can open them.

Documents never go through Kirby's public media folder: they are served by a route that requires a Panel user who can read the application.

The content folder holds personal data from then on:

  • keep content/_drafts/applications-inbox out of Git (.gitignore);
  • make sure deployments do not delete or overwrite it;
  • include it in backups;
  • delete applications once your retention period is over (deleting the page deletes its documents).

Email

Each application is notified by email to the recipients, with a link to the application in the Panel. Replying to the email writes to the candidate. Documents are not attached: they can only be opened in the Panel.

The email is sent with Kirby's email configuration (email.transport). If it fails, the application is still stored and the error is logged.

Configuration

KeyTypeDefaultDescription
studio-variable.applications.recipientsstring\|array\|Closure\|nullnullWho is notified; null is every admin user
studio-variable.applications.fromstring\|nullnullSender address; null is noreply@ followed by the site's domain
studio-variable.applications.fieldsarraysee belowText fields of the form
studio-variable.applications.filesarraysee belowPDF documents of the form
studio-variable.applications.maxFileSizeint5242880Maximum size of each document, in bytes (5 MB)
studio-variable.applications.minDelayint3Minimum seconds between displaying and sending the form
studio-variable.applications.maxAgeint86400Maximum seconds between displaying and sending the form
studio-variable.applications.rateLimitint5Applications allowed per IP address and window
studio-variable.applications.rateWindowint3600Length of the rate limit window, in seconds
studio-variable.applications.honeypotstring'website'Name of the hidden honeypot field
studio-variable.applications.secretstring\|nullnullSecret used to sign forms; null generates one
studio-variable.applications.parentstring'applications-inbox'Slug of the draft page holding applications
studio-variable.applications.iconstring'email'Icon of the page holding applications

Fields

'studio-variable.applications.fields' => [
    'firstname' => ['type' => 'text', 'required' => true, 'maxLength' => 100],
    'lastname'  => ['type' => 'text', 'required' => true, 'maxLength' => 100],
    'email'     => ['type' => 'email', 'required' => true, 'maxLength' => 254],
    'phone'     => ['type' => 'tel', 'required' => false, 'maxLength' => 40],
    'message'   => ['type' => 'textarea', 'required' => true, 'maxLength' => 5000],
],

type is text, email, tel or textarea. Add a label to name a field not covered by the translations. The page title is built from firstname and lastname, and email is used to reply to the candidate.

Files

'studio-variable.applications.files' => [
    'cv'     => ['required' => true],
    'letter' => ['required' => false],
],

Translations

English and French are included, for the Panel, the messages shown to candidates and the emails. Keys start with studio-variable.applications.; see src/extensions/translations.php.

License

MIT License © 2026 Studio Variable