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

[5.2] Workflow emails #37860

Open
wants to merge 19 commits into
base: 5.2-dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
INSERT IGNORE INTO `#__mail_templates` (`template_id`, `extension`, `language`, `subject`, `body`, `htmlbody`, `attachments`, `params`) VALUES
('plg_workflow_notification.mail', 'plg_workflow_notification', '', 'PLG_WORKFLOW_NOTIFICATION_EMAIL_ON_TRANSITION_SUBJECT', 'PLG_WORKFLOW_NOTIFICATION_EMAIL_ON_TRANSITION_MSG', '', '', '{"tags":["siteurl","title","user","transitionname","tostage","extratext"]}');
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
INSERT INTO "#__mail_templates" ("template_id", "extension", "language", "subject", "body", "htmlbody", "attachments", "params") VALUES
('plg_workflow_notification.mail', 'plg_workflow_notification', '', 'PLG_WORKFLOW_NOTIFICATION_EMAIL_ON_TRANSITION_SUBJECT', 'PLG_WORKFLOW_NOTIFICATION_EMAIL_ON_TRANSITION_MSG', '', '', '{"tags":["siteurl","title","user","transitionname","tostage","extratext"]}')
ON CONFLICT DO NOTHING;
10 changes: 9 additions & 1 deletion administrator/language/en-GB/plg_workflow_notification.ini
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,20 @@ PLG_WORKFLOW_NOTIFICATION="Workflow - Notification"
PLG_WORKFLOW_NOTIFICATION_ADDTEXT="The stage has changed"
PLG_WORKFLOW_NOTIFICATION_ADDTEXT_DESC="This text will be sent: Title [title], changed by [user], new state: [state]. You can add your own text to this message and you can localise the text by using a language key and creating a language override."
PLG_WORKFLOW_NOTIFICATION_ADDTEXT_LABEL="Additional Message Text"
PLG_WORKFLOW_NOTIFICATION_EMAIL_ON_TRANSITION_MSG="Title: {TITLE}. Transition {TRANSITIONNAME} performed by {USER}. New state: {TOSTAGE}.{EXTRATEXT}"
roland-d marked this conversation as resolved.
Show resolved Hide resolved
PLG_WORKFLOW_NOTIFICATION_EMAIL_ON_TRANSITION_SUBJECT="The status of {TITLE} has been changed"
PLG_WORKFLOW_NOTIFICATION_MAIL_MAIL_DESC="Mail sent to the selected usergroup and/or users set for the transition"
PLG_WORKFLOW_NOTIFICATION_MAIL_MAIL_TITLE="Workflow: Transition Mail"
PLG_WORKFLOW_NOTIFICATION_NO_TITLE="Unknown title"
PLG_WORKFLOW_NOTIFICATION_ON_TRANSITION_MSG="Title: %1$s. Transition \"%2$s\" performed by %3$s. New state: %4$s."
PLG_WORKFLOW_NOTIFICATION_ON_TRANSITION_SUBJECT="The status of \"%s\" has been changed"
PLG_WORKFLOW_NOTIFICATION_NO_TITLE="Unknown title"
PLG_WORKFLOW_NOTIFICATION_RECEIVERS_LABEL="Users"
PLG_WORKFLOW_NOTIFICATION_SENDMAIL_LABEL="Send Notification"
PLG_WORKFLOW_NOTIFICATION_SENT="Notifications sent"
PLG_WORKFLOW_NOTIFICATION_TYPE_DESC="Select one or more notification types you would like to use"
roland-d marked this conversation as resolved.
Show resolved Hide resolved
roland-d marked this conversation as resolved.
Show resolved Hide resolved
PLG_WORKFLOW_NOTIFICATION_TYPE_EMAIL="Email"
PLG_WORKFLOW_NOTIFICATION_TYPE_LABEL="Notification Type"
PLG_WORKFLOW_NOTIFICATION_TYPE_MESSAGES="Private Messages"
PLG_WORKFLOW_NOTIFICATION_USERGROUP_DESC="The users in this usergroup get a notification if this transition has been performed."
PLG_WORKFLOW_NOTIFICATION_USERGROUP_LABEL="Usergroups"
PLG_WORKFLOW_NOTIFICATION_XML_DESCRIPTION="Send notification if a transition has been performed in a workflow."
3 changes: 2 additions & 1 deletion installation/sql/mysql/supports.sql
Original file line number Diff line number Diff line change
Expand Up @@ -438,4 +438,5 @@ INSERT INTO `#__mail_templates` (`template_id`, `extension`, `language`, `subjec
('plg_system_tasknotification.failure_mail', 'plg_system_tasknotification', '', 'PLG_SYSTEM_TASK_NOTIFICATION_FAILURE_MAIL_SUBJECT', 'PLG_SYSTEM_TASK_NOTIFICATION_FAILURE_MAIL_BODY', '', '', '{"tags": ["task_id", "task_title", "exit_code", "exec_data_time", "task_output"]}'),
('plg_system_tasknotification.fatal_recovery_mail', 'plg_system_tasknotification', '', 'PLG_SYSTEM_TASK_NOTIFICATION_FATAL_MAIL_SUBJECT', 'PLG_SYSTEM_TASK_NOTIFICATION_FATAL_MAIL_BODY', '', '', '{"tags": ["task_id", "task_title"]}'),
('plg_system_tasknotification.orphan_mail', 'plg_system_tasknotification', '', 'PLG_SYSTEM_TASK_NOTIFICATION_ORPHAN_MAIL_SUBJECT', 'PLG_SYSTEM_TASK_NOTIFICATION_ORPHAN_MAIL_BODY', '', '', '{"tags": ["task_id", "task_title"]}'),
('plg_system_tasknotification.success_mail', 'plg_system_tasknotification', '', 'PLG_SYSTEM_TASK_NOTIFICATION_SUCCESS_MAIL_SUBJECT', 'PLG_SYSTEM_TASK_NOTIFICATION_SUCCESS_MAIL_BODY', '', '', '{"tags":["task_id", "task_title", "exec_data_time", "task_output"]}');
('plg_system_tasknotification.success_mail', 'plg_system_tasknotification', '', 'PLG_SYSTEM_TASK_NOTIFICATION_SUCCESS_MAIL_SUBJECT', 'PLG_SYSTEM_TASK_NOTIFICATION_SUCCESS_MAIL_BODY', '', '', '{"tags":["task_id", "task_title", "exec_data_time", "task_output"]}'),
('plg_workflow_notification.mail', 'plg_workflow_notification', '', 'PLG_WORKFLOW_NOTIFICATION_EMAIL_ON_TRANSITION_SUBJECT', 'PLG_WORKFLOW_NOTIFICATION_EMAIL_ON_TRANSITION_MSG', '', '', '{"tags":["siteurl","title","user","transitionname","tostage","extratext"]}');
3 changes: 2 additions & 1 deletion installation/sql/postgresql/supports.sql
Original file line number Diff line number Diff line change
Expand Up @@ -449,4 +449,5 @@ INSERT INTO "#__mail_templates" ("template_id", "extension", "language", "subjec
('plg_system_tasknotification.failure_mail', 'plg_system_tasknotification', '', 'PLG_SYSTEM_TASK_NOTIFICATION_FAILURE_MAIL_SUBJECT', 'PLG_SYSTEM_TASK_NOTIFICATION_FAILURE_MAIL_BODY', '', '', '{"tags": ["task_id", "task_title", "exit_code", "exec_data_time", "task_output"]}'),
('plg_system_tasknotification.fatal_recovery_mail', 'plg_system_tasknotification', '', 'PLG_SYSTEM_TASK_NOTIFICATION_FATAL_MAIL_SUBJECT', 'PLG_SYSTEM_TASK_NOTIFICATION_FATAL_MAIL_BODY', '', '', '{"tags": ["task_id", "task_title"]}'),
('plg_system_tasknotification.orphan_mail', 'plg_system_tasknotification', '', 'PLG_SYSTEM_TASK_NOTIFICATION_ORPHAN_MAIL_SUBJECT', 'PLG_SYSTEM_TASK_NOTIFICATION_ORPHAN_MAIL_BODY', '', '', '{"tags": ["task_id", "task_title"]}'),
('plg_system_tasknotification.success_mail', 'plg_system_tasknotification', '', 'PLG_SYSTEM_TASK_NOTIFICATION_SUCCESS_MAIL_SUBJECT', 'PLG_SYSTEM_TASK_NOTIFICATION_SUCCESS_MAIL_BODY', '', '', '{"tags":["task_id", "task_title", "exec_data_time", "task_output"]}');
('plg_system_tasknotification.success_mail', 'plg_system_tasknotification', '', 'PLG_SYSTEM_TASK_NOTIFICATION_SUCCESS_MAIL_SUBJECT', 'PLG_SYSTEM_TASK_NOTIFICATION_SUCCESS_MAIL_BODY', '', '', '{"tags":["task_id", "task_title", "exec_data_time", "task_output"]}'),
('plg_workflow_notification.mail', 'plg_workflow_notification', '', 'PLG_WORKFLOW_NOTIFICATION_EMAIL_ON_TRANSITION_SUBJECT', 'PLG_WORKFLOW_NOTIFICATION_EMAIL_ON_TRANSITION_MSG', '', '', '{"tags":["siteurl","title","user","transitionname","tostage","extratext"]}');
15 changes: 15 additions & 0 deletions plugins/workflow/notification/forms/action.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,21 @@
<option value="0">JNO</option>
<option value="1">JYES</option>
</field>

<field
name="notification_type"
type="list"
label="PLG_WORKFLOW_NOTIFICATION_TYPE_LABEL"
description="PLG_WORKFLOW_NOTIFICATION_TYPE_DESC"
layout="joomla.form.field.list-fancy-select"
showon="notification_send_mail:1"
multiple="true"
default="messages"
>
<option value="messages">PLG_WORKFLOW_NOTIFICATION_TYPE_MESSAGES</option>
<option value="email">PLG_WORKFLOW_NOTIFICATION_TYPE_EMAIL</option>
</field>

<field
name="notification_text"
type="textarea"
Expand Down
Loading