Skip to content

Improve Form block resilience: save entry to database before sending email and log errors #2775

@pirate-bot

Description

@pirate-bot

Impact: 90 · Confidence: 95 · Complexity: 60

Description

Problem

Currently, if a Form block fails to send an email (e.g., due to SMTP or server issues outside of Otter), the submission fails and the data is lost entirely. The entry is not saved to the Otter Pro database, resulting in lost leads and opt-ins. Furthermore, when forms silently fail, site owners have no access to error logs or messages to understand why it failed.

Desired Behavior

The form submission architecture should be refactored so that the entry is recorded in the database before attempting downstream actions like sending email notifications. If email delivery fails, the submission still remains safe in the database. Additionally, any errors (such as wp_mail failures or integration errors) should be logged or surfaced to assist admins with troubleshooting.

Acceptance Criteria

  • Form submissions are saved to the local database immediately upon submission, before triggering email sending or other external actions.
  • A failure in email delivery does not delete or prevent the entry from being available in the database.
  • Form processing errors (such as email failures) are captured and logged (e.g., in a debug log or marked on the database entry itself) for easier troubleshooting.

Customer Context

The customer is an Otter Pro user trying to collect opt-ins. They experienced silent form failures due to an external email issue. Because the form failed at the email step, none of the submissions were saved to their newly upgraded Pro database, causing data loss. The customer requests saving to the database first, and adding error logs so they can actually troubleshoot when forms fail without relying on support. (Note: The customer is highly frustrated because they had trouble accessing the premium support portal due to missing password reset/magic link emails).

Reasoning

The customer identified a critical flaw in the Form Block's submission flow: if an email fails to send due to external server issues, the form entry is lost completely without being saved to the Otter Pro database. They are requesting that form submissions be saved to the database before attempting to send emails to prevent data loss. They also requested better error logging for form failures. No existing GitHub issues were found for these enhancements.


Source: HelpScout #3292257982
Generated by feature-request-triage workflow (ID: feature-request-triage_69dffc6a27e074.17590985)

Metadata

Metadata

Assignees

No one assigned

    Labels

    customer reportIndicates the request came from a customer.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions