Files
Viktor Miller ac60de5d99 docs(05): create phase plan
Phase 05: Mentor Job Board
- 3 plans created (parallel-ready)
- 5 total tasks defined
- Ready for execution

Plans:
- 05-01: Archive access control and query setup
- 05-02: Job application form with provider notification
- 05-03: Logo auto-crop to 200x200px

All plans independent (depends_on: []), can execute in parallel.
2026-01-14 20:22:35 +09:00

6.7 KiB

phase, plan, type, depends_on, files_modified
phase plan type depends_on files_modified
05-mentor-job-board 02 execute
includes/class-formidable.php
includes/class-notifications.php
Create job application form for mentors with email notification to provider, enabling mentor-to-provider direct contact.

Purpose: Allow mentors to express interest in jobs by submitting application with name, email, message. Provider receives email with applicant details and can respond directly. Output: Formidable application form with email notification to job contact email.

<execution_context> ~/.claude/get-shit-done/workflows/execute-plan.md ./summary.md </execution_context>

@.planning/PROJECT.md @.planning/ROADMAP.md @.planning/STATE.md

Prior work this plan builds on:

@.planning/phases/02-provider-registration-auth/02-01-SUMMARY.md @.planning/phases/03-job-management-core/03-01-SUMMARY.md @.planning/phases/03-job-management-core/03-03-SUMMARY.md @.planning/phases/04-job-deactivation-system/04-02-SUMMARY.md

Source files:

@includes/class-formidable.php @includes/class-notifications.php @includes/class-acf-fields.php

Tech stack available: formidable-forms, wp_mail, get_field() for ACF fields Established patterns:

  • Programmatic Formidable form creation with duplicate prevention via form key (Phase 02-01, 03-01)
  • Email notifications using wp_mail with German templates (Phase 03-03, 04-02)
  • Success redirect after form submission (Phase 03-01)
  • ACF field access for job metadata (job_contact_email, job_logo, etc.)

Constraining decisions:

  • Phase 02-01: Formidable forms created programmatically, check for existing via form key
  • Phase 03-03: Email templates in German with job context
  • Phase 03-03: Error logging for wp_mail failures
  • Phase 01-03: Job contact email stored in ACF field 'job_contact_email'
  • PROJECT.md: Job detail page with apply button → popup form → email to provider
Task 1: Create job application form in Formidable class includes/class-formidable.php Add create_job_application_form() method following established pattern from create_job_submission_form(). Check for existing form by key 'job_application' to prevent duplicates. Include 4 fields: (1) applicant_name text (required, German label "Name"), (2) applicant_email email (required, German label "E-Mail", pre-fill with current_user email if logged in via default_value), (3) applicant_message textarea (required, German label "Nachricht", description "Warum interessieren Sie sich für diese Stelle?"), (4) hidden field job_id for post identification. Form title: "Jetzt bewerben". Submit button: "Bewerbung absenden". Success message: "Ihre Bewerbung wurde versendet. Der Anbieter wird sich bei Ihnen melden." No success redirect (stays on detail page). Add form action hook to trigger email notification (see Task 2). Add get_job_application_form_id() helper following established pattern. Register form creation in setup_registration_hooks(). Check class-formidable.php contains create_job_application_form() and get_job_application_form_id() methods. Verify form configured with 4 fields (name, email, message, job_id). Confirm email pre-fill logic for logged-in users. Application form created programmatically, fields include applicant details and job_id, form ID getter exists, pre-fill logic for logged-in users Task 2: Add application notification method to notifications class includes/class-notifications.php Add send_provider_application_notification() method following pattern from send_admin_new_job_notification(). Hook to frm_after_create_entry (Formidable form submission hook) with form_id check matching job_application form. Extract entry fields: applicant_name, applicant_email, applicant_message, job_id. Get job post: get_post($job_id). Extract job details: job_title (post_title), job_location (get_field), job_type (get_field). Get provider contact email: get_field('job_contact_email', $job_id) - this is where application goes. Email subject: "Neue Bewerbung für: {job_title}". Email body (German): "Sie haben eine neue Bewerbung für Ihr Stellenangebot erhalten.\\n\\nStelle: {job_title}\\nStandort: {job_location}\\nArt: {job_type}\\n\\n--- Bewerber ---\\nName: {applicant_name}\\nE-Mail: {applicant_email}\\n\\nNachricht:\\n{applicant_message}\\n\\n---\\nBitte antworten Sie direkt an {applicant_email}.\\n\\nDiese E-Mail wurde automatisch gesendet." Send to provider contact email (from ACF field). Include error_log if job_contact_email missing or wp_mail fails. Register hook in setup_hooks() method following existing pattern. Check includes/class-notifications.php contains send_provider_application_notification() method. Verify hook registered for frm_after_create_entry with form ID check. Confirm email includes all applicant details and job context. Verify email sent to ACF field job_contact_email. Application notification method exists, hook registered for Formidable submissions, email includes applicant info and job details, sent to provider contact email from ACF field Before declaring plan complete: - [ ] Application form exists with key 'job_application' - [ ] Form has 4 fields: applicant_name, applicant_email, applicant_message, job_id - [ ] Email pre-fills current user email for logged-in mentors - [ ] Application notification hook registered for form submissions - [ ] Email sent to provider contact email (ACF field job_contact_email) - [ ] Email includes applicant details and job context - [ ] Error logging handles missing contact email or wp_mail failures

<success_criteria>

  • Application form created programmatically in class-formidable.php
  • Form includes applicant details (name, email, message) and hidden job_id
  • Form submission triggers email to provider contact email
  • Email includes full context (applicant info + job details)
  • Logged-in mentors have email pre-filled for convenience
  • Provider can reply directly to applicant email </success_criteria>
After completion, create `.planning/phases/05-mentor-job-board/05-02-SUMMARY.md`:

Phase 5 Plan 2: Job Application Form Summary

[Substantive one-liner - what shipped, not "phase complete"]

Accomplishments

  • [Key outcome 1]
  • [Key outcome 2]

Files Created/Modified

  • includes/class-formidable.php - Description
  • includes/class-notifications.php - Description

Decisions Made

[Key decisions and rationale, or "None"]

Issues Encountered

[Problems and resolutions, or "None"]

Next Step

Ready for parallel execution with 05-01 and 05-03 (independent plans).