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

Refactor email templates to better support discovery, reuse and documentation #5716

Closed
NateWr opened this issue Apr 9, 2020 · 14 comments
Closed
Assignees
Labels
Enhancement:3:Major A new feature or improvement that will take a month or more to complete. Housekeeping:1:Todo Any dependency management or refactor that would be nice to have some day.
Milestone

Comments

@NateWr
Copy link
Contributor

NateWr commented Apr 9, 2020

Describe the problem you would like to solve
Journal managers want to be able to configure email templates to support a wide range of needs throughout the applications. These include:

Describe the solution you'd like
We'll need a list in the application that defines each possible event that results in an email, and this must be hooked so that plugins can add their own events. Each event can define what variables are available in the email template.

Email templates, including the default templates, should define which events they can be used for. This should be configurable for custom templates but not for default templates, so that journal managers can not accidentally configure no templates for an event.

With this information, it should be possible to accomplish the following:

  • Filters in the email templates list for workflow stage or event that allow managers to quickly find the email template they want.
  • The ability to call up a list of valid templates for each email event, such as a new discussion, request for revisions, etc. And then let the user select from the allowed templates.
  • The ability for journal managers to configure which templates are valid for which events.

As part of longer-term refactoring, it probably makes sense to refactor this so that it is distinct from the Notification and NotificationManager classes that exist.

It may also be worth investigating Laravel's Notification system to see if it might replace our existing system or inspire our refactor.

Who is asking for this feature?
This is a requirement to implement some of the features described above, which have been requested by community members and PS.

Pull Requests
See comment:

@NateWr NateWr added the Housekeeping:1:Todo Any dependency management or refactor that would be nice to have some day. label Apr 9, 2020
@ajnyga
Copy link
Collaborator

ajnyga commented Apr 9, 2020

Not sure if this is included in the suggestions above. But the list should somehow show which templates are used based on chosen settings. For example if one-click is enabled, only some of the review templates are used (should we combine some of those templates is of course another question).

@asmecher asmecher added this to the OJS/OMP/OPS 3.4 milestone Nov 17, 2020
@NateWr NateWr added the Enhancement:2:Moderate A new feature or improvement that can be implemented in less than 4 weeks. label Aug 11, 2022
@NateWr
Copy link
Contributor Author

NateWr commented Aug 11, 2022

The following are some preliminary mockups of how the new email management UI will work.

Manage emails

This looks similar to the existing email templates UI, except it only lists email events. For example, a single email is shown for "Submission Accepted", but the editor will be able to assign more than one email template to use for that event.

Manage Emails

Emails with just one template

When an email is sent automatically, the editor doesn't have an opportunity to edit the email or select a different template. In such cases, the email will only have one template. The edit button will open a modal to edit that template.

(Some emails the editor can edit will still only support one template until we can refactor them.)

Edit Automatic Email

Emails with many templates

When editing an email that the editor previews and edits, such as when recording an editorial decision, they can edit the default template and create custom templates. See a mockup of the new Load Template UI when writing an email.

Edit Email with Many Templates

Email template variables

When editing an email template, the user will be able to see all of the variables they can use.

Variables

NateWr added a commit to NateWr/pkp-lib that referenced this issue Oct 31, 2022
NateWr added a commit to NateWr/pkp-lib that referenced this issue Nov 2, 2022
NateWr added a commit to NateWr/pkp-lib that referenced this issue Nov 2, 2022
NateWr added a commit to NateWr/ui-library that referenced this issue Nov 3, 2022
NateWr added a commit to NateWr/pkp-lib that referenced this issue Nov 3, 2022
NateWr added a commit to NateWr/ojs that referenced this issue Nov 3, 2022
NateWr added a commit to NateWr/pkp-lib that referenced this issue Nov 3, 2022
NateWr added a commit to NateWr/pkp-lib that referenced this issue Nov 3, 2022
NateWr added a commit to NateWr/pkp-lib that referenced this issue Nov 3, 2022
NateWr added a commit to NateWr/ui-library that referenced this issue Nov 3, 2022
…list

This commit replaces the email templates list with a new Manage Emails UI
based on our new Mailables system. It includes the following changes:

- Adds ManageEmailsPage to edit and assign mailable templates
- All email templates now have a name
- Email templates list panel removed
NateWr added a commit to NateWr/pkp-lib that referenced this issue Nov 3, 2022
This commit replaces the email templates list with a new Manage Emails UI
based on our new Mailables system. It includes the following changes:

- Refactor relationship between mailables and email templates. All email
  templates now assigned to a mailable.
- Adds settings page to edit and assign mailable templates
- Remove email templates management list panel
- Migrate existing custom templates to new discussion stage mailables
- Migrate disabled email template functionality to new context settings
- Add alternateTo attribute to emailTemplates.xml for extra templates
- Give all email templates a name
- Generate custom template keys from the name
- Updates to several mailable names, descriptions, filter settings, etc.
NateWr added a commit to NateWr/ui-library that referenced this issue Nov 3, 2022
…list

This commit replaces the email templates list with a new Manage Emails UI
based on our new Mailables system. It includes the following changes:

- Adds ManageEmailsPage to edit and assign mailable templates
- All email templates now have a name
- Email templates list panel removed
NateWr added a commit to NateWr/pkp-lib that referenced this issue Nov 3, 2022
This commit replaces the email templates list with a new Manage Emails UI
based on our new Mailables system. It includes the following changes:

- Refactor relationship between mailables and email templates. All email
	templates now assigned to a mailable.
- Adds settings page to edit and assign mailable templates
- Remove email templates management list panel
- Migrate existing custom templates to new discussion stage mailables
- Migrate disabled email template functionality to new context settings
- Add alternateTo attribute to emailTemplates.xml for extra templates
- Give all email templates a name
- Generate custom template keys from the name
- Updates to several mailable names, descriptions, filter settings, etc.
NateWr added a commit to NateWr/ojs that referenced this issue Nov 3, 2022
NateWr added a commit to NateWr/pkp-lib that referenced this issue Nov 3, 2022
NateWr added a commit to NateWr/ops that referenced this issue Nov 30, 2022
@NateWr
Copy link
Contributor Author

NateWr commented Nov 30, 2022

@asmecher it was a little bit messy because the same code is used for installing and migrations. For minimal impact, I just duplicated some code into Installer.php and then into the individual migrations. See a8bfeae and pkp/ojs@643e979.

NateWr added a commit to pkp/ui-library that referenced this issue Nov 30, 2022
pkp/pkp-lib#5716 Add new manage emails UI and remove email templates …
NateWr added a commit that referenced this issue Nov 30, 2022
#5716 Add new manage emails UI and remove email templates list
NateWr added a commit to pkp/ojs that referenced this issue Nov 30, 2022
pkp/pkp-lib#5716 Add new manage emails UI and remove email templates list
NateWr added a commit to pkp/omp that referenced this issue Nov 30, 2022
pkp/pkp-lib#5716 Add new manage emails UI and remove email templates list
NateWr added a commit to pkp/ops that referenced this issue Nov 30, 2022
pkp/pkp-lib#5716 Add new manage emails UI and remove email templates list
@NateWr
Copy link
Contributor Author

NateWr commented Nov 30, 2022

🎉 All merged. Thanks for all your work on this @Vitaliy-1!

@NateWr NateWr closed this as completed Nov 30, 2022
NateWr added a commit to NateWr/ojs that referenced this issue Dec 8, 2022
NateWr added a commit to NateWr/omp that referenced this issue Dec 8, 2022
NateWr added a commit to NateWr/ops that referenced this issue Dec 8, 2022
@NateWr
Copy link
Contributor Author

NateWr commented Dec 8, 2022

@NateWr NateWr reopened this Dec 8, 2022
NateWr added a commit to pkp/ops that referenced this issue Dec 8, 2022
NateWr added a commit to pkp/omp that referenced this issue Dec 8, 2022
NateWr added a commit to pkp/ojs that referenced this issue Dec 8, 2022
@NateWr
Copy link
Contributor Author

NateWr commented Dec 8, 2022

All merged.

@NateWr NateWr closed this as completed Dec 8, 2022
NateWr added a commit to NateWr/ui-library that referenced this issue Dec 12, 2022
withanage pushed a commit to withanage/ojs that referenced this issue Dec 14, 2022
withanage pushed a commit to withanage/ojs that referenced this issue Dec 14, 2022
withanage pushed a commit to withanage/ojs that referenced this issue Dec 14, 2022
withanage pushed a commit to withanage/ojs that referenced this issue Dec 14, 2022
@NateWr NateWr added Enhancement:3:Major A new feature or improvement that will take a month or more to complete. and removed Enhancement:2:Moderate A new feature or improvement that can be implemented in less than 4 weeks. labels Feb 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement:3:Major A new feature or improvement that will take a month or more to complete. Housekeeping:1:Todo Any dependency management or refactor that would be nice to have some day.
Projects
Status: Done
Status: No status
Development

No branches or pull requests

5 participants