Problem/Motivation
When using the Mailgun module I receive a "There was a problem sending your message and it was not sent." error when submitting the contact form. However, the email was sent fine. The issue seems to be line 246 of src/Form/ContactForm.php that checks if $result['result'] !== TRUE. Mailgun however returns an object with an id and message.
"result" => Mailgun\Model\Message\SendResponse {#2598 ▼
-id: "<20240814210540.123456789abcd@example.com>"
-message: "Queued. Thank you."
}Proposed resolution
Reverse the check to
$result['result'] === FALSE
or simplify it to
if (empty($result['result']))
| Comment | File | Size | Author |
|---|---|---|---|
| #12 | send-result-check-error-3468195-12.patch | 1.87 KB | jphelan |
| #3 | send-result-check-error-3468195-1.patch | 981 bytes | jphelan |
Issue fork email_contact-3468210
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
jphelan commentedComment #4
jphelan commentedComment #5
jphelan commentedComment #6
jphelan commentedComment #7
jphelan commentedComment #8
nagy.balint commentedI think, we need to go with empty, cause FALSE is fail, and NULL is cancelled.
in core they use if (!$message['result']) { but likely empty is better.
Comment #11
jphelan commentedOk, I've created a new revised MR.
Comment #12
jphelan commentedComment #13
nagy.balint commentedComment #15
nagy.balint commented