On this page
Approach
Last updated on
9 March 2026
Inspiration
As a starting point, I referred to this article about sending email programmatically. Fortunately, the example in this article sends email when content of a specific type is updated. I was able to use this as the basis for the custom module.
The Simple Content Notifications module will create notifications when content (nodes) is created, updated, or deleted. The module employs a hook for each content event:
- hook_ENTITY_TYPE_insert() to create notifications when nodes are created
- hook_ENTITY_TYPE_update() for notifications when nodes are changed
- hook_ENTITY_TYPE_delete() for notifications when nodes are removed.
In addition, the hook_mail() hook defines the three types of mail messages that can be generated.
email Notifications
The email notifications created by the module are very simple. The subject line of the email includes the title of the node that has been acted upon. The body of the message indicates:
- The node type
- The action performed (creation, update, deletion)
- The title of the node
- The username (UNI) of the user who performed the action
- The URL of the node (unless deleted)
Help improve this page
Page status: No known problems
You can:
You can:
- Log in, click Edit, and edit this page
- Log in, click Discuss, update the Page status value, and suggest an improvement
- Log in and create a Documentation issue with your suggestion