Skip to content

No emails are sent when a new user registers via the checkout "Account creation" form (LearnPress 4.4.3) #638

Description

@Kolpic

Environment

  • LearnPress: 4.4.3 (free version, latest)
  • WordPress: 7.0.2
  • Theme: TheGem; other notable plugins: WPML (Multilingual CMS + String Translation), Contact Form 7, SEOPress
  • Mail verified working: confirmed with WP Mail Logging; core WordPress emails (password reset, new user notification) are delivered to Gmail without issues. No SMTP plugin (default wp_mail).

LearnPress settings

  • Settings → Payments: Guest checkout = OFF, Account login = ON, Account creation = ON
  • Settings → Emails: ALL relevant emails enabled, including New Order → User/Guest, Processing Order → User/Guest, Completed Order → User/Guest, Enrolled Course → Admin/User

Steps to reproduce

  1. As a logged-out visitor, open a free course and click Enroll → redirected to the checkout page.
  2. The checkout shows the registration form (because "Account creation" is enabled). Fill it in and submit.
  3. The account is created, the user is logged in and enrolled; the LP order is created and its status is "Completed", correctly attributed to the new user (not Guest).
  4. Check the email log.

Actual result
Only the core WordPress emails fire (New User Registration to admin + "Login details" to the user). LearnPress generates ZERO emails for this order/enrollment — no New Order, no Completed Order, no Enrolled Course, neither the User nor the Guest variants, neither to the customer nor to the admin. WP Mail Logging shows wp_mail() is never called by LearnPress in this flow, so this is not a delivery/SMTP problem — the emails are never generated.

Expected result
The same emails that are sent for a logged-in enrollment: New Order → Admin/User, Completed Order → Admin/User, Enrolled Course → Admin/User.

Control test (works correctly)
If the SAME user logs in first and then enrolls in the same free course, all 6 emails are generated and delivered instantly (verified in the mail log with zero errors). So the bug is exclusively in the "register during checkout" code path.

Already ruled out

  • Emails disabled in settings (all enabled, including Guest variants — enabling them made no difference)
  • Mail delivery/SMTP (core WP emails deliver fine; wp_mail is never invoked by LP in this flow)
  • Caching (LearnPress → Tools → Cache cleared; email settings re-saved; plugin deactivated/reactivated)
  • Cron (Site Health reports no scheduled-event issues)

Workaround we are using
We disabled "Account creation" on checkout and added a notice (via the learn-press/after-checkout-account-login-fields hook) linking new users to the LearnPress profile page registration form. Registration via the profile page followed by enrollment sends all emails correctly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions