Search code examples
espocrm

EspoCRM: Send custom email when a comment is written in the Stream of a custom entity


I created a custom entity named "Project". Each time a comment is written in the Stream section of a project, I need to send the comment via email to the comment author AND to the target account of the project.

The email subject must be structured as follows: "[<Project_ID>] New comment on <Project_Name>". Ex: [123] New comment on Sample Project.

Does EspoCRM allow to solve a problem like this? If true, please provide guidance, useful docs, etc. I have explored the docs but no success to solve this specific problem.


Solution

  • Here is some good information:

    • The entity name is Note, so every record on stream panel is a Note entity.
    • Note entity is not customizable by design, because it is core entity.
    • A way to send emails conditionally in Espocrm is Formula.
    • Note is not customizable, so cannot write formula for it.
    • To make it customizable, create this file:
    • Path: custom/Espo/Custom/Resources/metadata/scopes/Note.json
    • Contect: {"customizable":true}