Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Metadata publication notifications / allow to configure the mail format #8497

Conversation

josegar74
Copy link
Member

This pull request allows to configure the mail format (html or text) for the metadata publication notifications in https://github.com/geonetwork/core-geonetwork/compare/main...GeoCat:core-geonetwork:44-metadatapublicationmails-configure-format?expand=1#diff-5c9ae0ecadc341dc6ccdf055599053c721d9eb3cb8e6d633e5c995a7346d7312R80

Default configuration sends html format as previously to this change.

In some systems the following mail messages are customised to contain text values:

metadata_published_text=The following records have been processed:\n\
<ul>%s</ul>
metadata_published_record_text=<li>The metadata <a href="{{link}}">{{index:resourceTitleObject}}</a> has been published.</li>
metadata_unpublished_record_text=<li>The metadata <a href="{{link}}">{{index:resourceTitleObject}}</a> has been unpublished.</li>
metadata_approved_published_record_text=<li>The metadata <a href="{{link}}">{{index:resourceTitleObject}}</a> has been published as a new version.</li>

Requiring to be sent as text, so can be processed to trigger some automated processes.


An alternative that was evaluated was to analyse the mail message to check if contains html tags with Jsoup, but the changes done in #8044 requires the format in the constructor, previous to do any processing of the mail templates / content.

public LocalizedEmail(Boolean isHtml) {

Checklist

  • I have read the contribution guidelines
  • Pull request provided for main branch, backports managed with label
  • Good housekeeping of code, cleaning up comments, tests, and documentation
  • Clean commit history broken into understandable chucks, avoiding big commits with hundreds of files, cautious of reformatting and whitespace changes
  • Clean commit messages, longer verbose messages are encouraged
  • API Changes are identified in commit messages
  • Testing provided for features or enhancements using automatic tests
  • User documentation provided for new features or enhancements in manual
  • Build documentation provided for development instructions in README.md files
  • Library management using pom.xml dependency management. Update build documentation with intended library use and library tutorials or documentation

@josegar74 josegar74 added this to the 4.4.7 milestone Nov 13, 2024
And metadata.publicationmail.format.html option.
Copy link
Contributor

@jodygarnett jodygarnett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While this is not ideal it is functional. I have documented the new setting (and the multi-lingual settings that you linked to).

@jodygarnett jodygarnett merged commit 4fa388c into geonetwork:main Nov 15, 2024
7 checks passed
@jodygarnett jodygarnett deleted the 44-metadatapublicationmails-configure-format branch November 15, 2024 18:00
jodygarnett added a commit to GeoCat/core-geonetwork that referenced this pull request Nov 15, 2024
…at (geonetwork#8497)

* Metadata publication notifications / allow to configure the mail format: html / text
* document multi-lingual email configuration, and metadata.publicationmail.format.html option.

Co-authored-by: Jose García <[email protected]>

---------

Co-authored-by: Jody Garnett <[email protected]>
@geonetwork geonetwork deleted a comment from geonetworkbuild Nov 15, 2024
jodygarnett added a commit that referenced this pull request Nov 15, 2024
…at (#8497)

* Metadata publication notifications / allow to configure the mail format: html / text
* document multi-lingual email configuration, and metadata.publicationmail.format.html option.

Co-authored-by: Jose García <[email protected]>

---------

Co-authored-by: Jody Garnett <[email protected]>
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.

3 participants