04PWEImplemented

Resend — automatic resending of notifications

A module that has transformed the 1–3 days spent manually resending Gravity Forms notifications before trade fairs into a process that is triggered by a single action and requires only monitoring.

My role
Design of the automation system and its logic; implementation of the module and control panel
Context
PWE · PWE System
Technologies
PHP · WordPress · Gravity Forms · AJAX
1–3 daysmanual work prior to the trade fairpre-automation status (PL/EN)
1launchfollowed by monitoring and logs

In a nutshell

  1. Problem

    Before every trade fair, Gravity Forms notifications had to be resent by hand, submission by submission. Even for just Polish and English this took around 1–3 working days (my estimate) — at the expense of other tasks.

  2. Solution

    The employee starts resending in a single step and periodically checks the progress. The system processes requests in batches, remembers where it left off, tailors notifications to the language and conditions of the form, and allows the employee to pause, resume and review logs.

  3. Outcome

    The process has shifted from manual ‘clicking’ to supervised operation: the human role is now limited to starting the process, monitoring it and responding to exceptions.

Problem

In the week leading up to the trade fair, we had to resend notifications to people who had previously registered via the forms. This involved manually reviewing forms, registrations and notification settings, as well as repeatedly triggering mailings — according to my estimate, 1–3 working days before each event, whilst still only handling Polish and English.

This was a task that was operationally necessary, but repetitive and required close attention to detail for each batch. With a greater number of languages, manually searching for the correct message variants would have further increased the cost and the risk of errors.

Features

  • Launching and controlling the process from the dashboard.
  • Processing of requests in batches, with configurable batch sizes and intervals.
  • Resuming from where the last part of the job left off.
  • Pausing, resuming and viewing logs.
  • Selection of notifications based on language and Gravity Forms settings.
  • Handling problematic submissions and the option for manual intervention.
  • Locks to prevent the same task from being executed simultaneously.

Administrator panel

The administrator selects forms and starts the resend task. They set the batch size, intervals between batches, the range of submissions and the minimum age of a submission.

  • Progress overview: number of candidates, as well as submissions sent, skipped and failed operations.
  • Event log for the entire task.
  • Pause and resume processing at any time.
  • In the event of specific recipient errors — skipping the problematic submission following intervention.

For the person managing the trade fair, the result is simple: instead of spending several days clicking away, they simply launch the tool and monitor progress and exceptions.

Selecting the right message

Before anything is sent, the system checks whether the submission is even eligible for a particular notification: matching the entry to the notification, language compatibility, Gravity Forms conditional rules and the correctness of the recipient’s address. It also distinguishes between special variants, e.g. by submission type.

The sending itself is handled by Gravity Forms’ own mechanisms, so the solution does not duplicate the email infrastructure. Sending errors are captured and added to the task status, and the report honestly distinguishes between handing a message over to the mail server and its delivery — the latter cannot be confirmed by WordPress itself.

Implementation

Task status, a cursor highlighting the current form and submission, checkpoints, locks and batch configuration — with a progress monitoring dashboard.

Task model

The task status includes an ID, status, selected forms, parameters, counters, results, log and cursor. The cursor stores the form index, the submission page, the specific submission and the notification — the next batch starts exactly from this point, without having to scan everything from the beginning.

  • States: running, paused, blocked, completed.
  • A checkpoint after each candidate has been processed.
  • A lock prevents the same task from being taken over by multiple requests, and its refresh signals the loss of authorisation to continue working.
  • In the event of an error whilst retrieving or sending submissions, the task is blocked with the position saved and an entry made in the log.

Result and further development

Manual processing, which used to take many hours, has been replaced by supervised batch processing. The former 1–3 days equal roughly 8–24 working hours per sending cycle (based on an eight-hour day, before subtracting the current supervision time).

The project demonstrates the design of stateful tasks on large datasets: exception handling, logging, message selection, concurrency control and the splitting of operations that cannot be reliably executed with a single HTTP request.

Direction of development: even less handling — fully background processing and a memory of sent notifications across cycles.