Send contact emails message when creating Contact Message via REST/JsonAPI

Created on 14 January 2018, almost 7 years ago
Updated 19 March 2024, 8 months ago

Problem/Motivation

Enable the Contact module and the POST /entity/contact_message REST endpoint. You can successfully create a contact message, however, the email will not be sent.

This is because the logic to send the message is in \Drupal\contact\MessageForm::save(). Since the logic is tied to the form, instead of the entity. The message should be sent when the entity is "saved".

Proposed resolution

Move the message sending logic to the entity instead of the form.

Remaining tasks

  1. Write Patch
  2. Review Patch

User interface changes

None

API changes

Creating a new contact_message will send the email(s) just like the UI does.

Data model changes

None.

✨ Feature request
Status

Needs work

Version

11.0 πŸ”₯

Component
ContactΒ  β†’

Last updated 4 days ago

Created by

πŸ‡ΊπŸ‡ΈUnited States davidwbarratt

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024