Skip to content

[5.4] POST com_contact form with webservices and custom reply enabled#47819

Merged
muhme merged 6 commits into
joomla:5.4-devfrom
alikon:patch-7
Jun 11, 2026
Merged

[5.4] POST com_contact form with webservices and custom reply enabled#47819
muhme merged 6 commits into
joomla:5.4-devfrom
alikon:patch-7

Conversation

@alikon

@alikon alikon commented May 24, 2026

Copy link
Copy Markdown
Contributor

Pull Request resolves #44927 alternative to #45136

  • I read the Generative AI policy and my contribution is either not created with the help of AI or is compatible with the policy and GNU/GPL 2 or later.

Summary of Changes

Refactor email sending logic in ContactController when no custom reply enabled

Testing Instructions

Set custom_reply parameter to true in com_contact
Try to send a message using webservices
POST https://yoursite/api/index.php/v1/contacts/form/{contact_id} with this example payload

{
    "contact_email": "email@example.org",
    "contact_message": "some text",
    "contact_name": "name",
    "contact_subject": "subject"
}

Actual result BEFORE applying this Pull Request

Exception

Expected result AFTER applying this Pull Request

no Exception

Link to documentations

Please select:

  • Documentation link for guide.joomla.org:

  • No documentation changes for guide.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

@alikon alikon marked this pull request as ready for review May 24, 2026 09:20
Comment thread api/components/com_contact/src/Controller/ContactController.php Outdated
Comment thread api/components/com_contact/src/Controller/ContactController.php Outdated
Co-authored-by: Richard Fath <richard67@users.noreply.github.com>
@ThomasFinnern

Copy link
Copy Markdown
Contributor

I have tested this item ✅ successfully on 555e138

The test were made by a PHP script calling curl function similar to manual.joomla.org doc.

I debugged with phpstorm and found following

  1. Parameter show_email_form
    @alikon: On first tests i got an exception on ContactController.php line 122. Which did not change with the patch.
    Surprisingly when i changed parameter 'contact->form->Contact Form' from 'Use Global (Show)' to 'show' this

  2. Patch results
    I do know i changed a lot of the settings before the above find. This is my actual result:
    Without patch: "Error sending message"
    With patch: ""

:


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/47819.

@exlemor

exlemor commented May 29, 2026

Copy link
Copy Markdown

@alikon with the Testing Instructions above, I get the same BEFORE and AFTER, code": 500, "title": "Internal server error". What am I doing wrong? :(

@alikon

alikon commented Jun 1, 2026

Copy link
Copy Markdown
Contributor Author

@exlemor my previous test instruction was very bad 😄
just enable the Custom Reply without pr you got execption
with pr no more

@exlemor

exlemor commented Jun 1, 2026

Copy link
Copy Markdown

Hi @alikon, I assume you are being funny ;) but that's what I understood the Testing Instructions to be but I get the same 500 internal server error with or without the Patch ;(

@QuyTon

QuyTon commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

I have tested this item ✅ successfully on 555e138


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/47819.

@QuyTon

QuyTon commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/47819.

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Jun 9, 2026
@muhme

muhme commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

✅ Final test before merge with JBT. In a new nightly build installation:

  • First see frontend to understand the functionality
    • Set Contacts > Form > Custom Reply: No
    • Created one contact, linked to user to ci-admin
      • ⚠️ set 'Contact Form: Show' for this contact, see 47942
    • Created menu item 'Single contact' with this contact
    • Was able to send email from site contact form
    • Was able to send email from API
  • See the issue error
    • Set Contacts > Form > Custom Reply: Yes
    • Sending email from site contact form is no more possible
      • Silent, w/o any notice, the formular is reopened with empty fields, no email sent from Joomla 👉 email have to be send by 3rd party plugin (not tested!)
    • Sending email with API fails with 400 'Error sending message'
  • Applied the PR with Patch Tester
    • ✅ Trying to send email with API is 200 OK, no email sent from Joomla 👉 email have to be send by 3rd party plugin (not tested!)

@muhme muhme merged commit d1118be into joomla:5.4-dev Jun 11, 2026
136 of 137 checks passed
@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Jun 11, 2026
@muhme

muhme commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Thank you very much @alikon for your contribution. Thanks to @QuyTon and @richard67 for review and support. Thanks to @exlemor, @ThomasFinnern and @QuyTon for testing.

@QuyTon QuyTon added this to the Joomla! 5.4.7 milestone Jun 11, 2026
@alikon alikon deleted the patch-7 branch June 12, 2026 06:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sending a message from com_contact using API with custom_reply set to true will most likely result in an Exception

7 participants