-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Workflow: Notifications & improvement to M.sendEmail()
Notifications make it easier to send 'notification' type emails during a workflow. They're defined using Workflow.notifications(), and automatically sent when a state matching their name is entered. Or manually with M.sendNotification(). Devtools lists defined notifications, and has a 'sent test email' button. specification for M.sendEmail() is improved to make it easier to define notifications without using lots of functions. * view property can be a function. * strings for recipients can refer to entity names, if they have a entity style _suffix * entity names are rewritten to use ref & maybe for efficiency and reliability
- Loading branch information
1 parent
84ab19a
commit d1dbcb6
Showing
6 changed files
with
165 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
emailSubject("Example notification") | ||
|
||
<p> "The workflow has finished" </p> | ||
|
||
<p> "Value is '" value "'" </p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
pageTitle("Notifications: " M.title) | ||
backLink(M.url) | ||
|
||
unless(notifications.length) { | ||
std:ui:notice("There are no notifications defined for this workflow") | ||
} else { | ||
<form method="POST"> std:form:token() | ||
<table> | ||
<tr> | ||
<th> "Name" </th> | ||
<th> "Test?" </th> | ||
</tr> | ||
each(notifications) { | ||
<td style="width:100px"> name </td> | ||
<td> | ||
<input type="submit" name="notification" value=["Test send: " name]> // value must end with ': <name of notification>' | ||
if(testSend) { | ||
" (email sent)" | ||
} | ||
</td> | ||
} | ||
</table> | ||
</form> | ||
} |