2 Commits
Author SHA1 Message Date
Patrick Niebeling ebf48b0707 Link the card title instead of an extra button in the mail
Build package / xml-lint (push) Successful in 1m14s
Build package / php-lint (8.4) (push) Successful in 2m14s
Build package / php-lint (8.5) (push) Successful in 2m15s
Build package / unit-tests (push) Successful in 2m17s
Build package / package (push) Successful in 59s
The plain-text part gets the card URL on its own line. Bumps to 35.2.2.
2026-09-30 11:05:22 +02:00
Patrick Niebeling 30e644a001 Condense each moved card to one sentence in the mail
Build package / xml-lint (push) Successful in 1m36s
Build package / php-lint (8.5) (push) Successful in 3m20s
Build package / php-lint (8.4) (push) Successful in 3m26s
Build package / unit-tests (push) Successful in 3m28s
Build package / package (push) Canceled after 21s
Drops the workflow name; the mail only says which card moved where.
Bumps to 35.2.1.
2026-09-30 11:02:04 +02:00
3 changed files with 26 additions and 16 deletions

No files matched your search

+1 -1
View File
@@ -24,7 +24,7 @@ This app lets every user configure Deck automation workflows for the boards they
A background job periodically evaluates all enabled workflows and moves cards whose due date has passed, using Deck's own internal PHP classes only (no HTTP/OCS calls). A background job periodically evaluates all enabled workflows and moves cards whose due date has passed, using Deck's own internal PHP classes only (no HTTP/OCS calls).
]]></description> ]]></description>
<version>35.2.0</version> <version>35.2.2</version>
<licence>agpl</licence> <licence>agpl</licence>
<author mail="patrick@niebel.ing">Patrick Niebeling</author> <author mail="patrick@niebel.ing">Patrick Niebeling</author>
<namespace>WorkflowDeckAutomation</namespace> <namespace>WorkflowDeckAutomation</namespace>
+24 -14
View File
@@ -98,24 +98,34 @@ class NotificationMailer {
* @param array{board: string, sourceStack: string, targetStack: string} $targets * @param array{board: string, sourceStack: string, targetStack: string} $targets
*/ */
private function addCard(IEMailTemplate $template, Workflow $workflow, Card $card, array $targets): void { private function addCard(IEMailTemplate $template, Workflow $workflow, Card $card, array $targets): void {
// Single-argument addBodyText() runs htmlspecialchars() itself, so // The card description and the workflow's name are deliberately left
// these card-, workflow-, board- and stack-titles (user input) are // out — the mail only says what moved where. The card title itself is
// safe as-is. The card description is deliberately left out. // the link to the card.
$template->addBodyText(sprintf( $sentence = '„%1$s“ (Board „%2$s“) ist überfällig und wurde von „%3$s“ nach „%4$s“ verschoben.';
'Die Karte „%1$s“ wurde verschoben, weil sie überfällig ist (Workflow „%2$s“).', $url = $this->urlGenerator->getAbsoluteURL('/apps/deck/board/' . $workflow->getBoardId() . '/card/' . $card->getId());
// With both parts passed, addBodyText() escapes nothing: every title
// is user input and has to be escaped here for the HTML part.
$html = sprintf(
$sentence,
'<a href="' . self::escape($url) . '">' . self::escape($card->getTitle()) . '</a>',
self::escape($targets['board']),
self::escape($targets['sourceStack']),
self::escape($targets['targetStack']),
);
$plain = sprintf(
$sentence,
$card->getTitle(), $card->getTitle(),
$workflow->getTitle(),
));
$template->addBodyText(sprintf(
'Board „%1$s“: von „%2$s“ nach „%3$s“ verschoben.',
$targets['board'], $targets['board'],
$targets['sourceStack'], $targets['sourceStack'],
$targets['targetStack'], $targets['targetStack'],
)); ) . PHP_EOL . $url;
$template->addBodyButton(
'Karte öffnen', $template->addBodyText($html, $plain);
$this->urlGenerator->getAbsoluteURL('/apps/deck/board/' . $workflow->getBoardId() . '/card/' . $card->getId()), }
);
private static function escape(string $text): string {
return htmlspecialchars($text, ENT_QUOTES, 'UTF-8');
} }
/** /**
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "workflow_deck_automation", "name": "workflow_deck_automation",
"version": "35.2.0", "version": "35.2.2",
"private": true, "private": true,
"type": "module", "type": "module",
"description": "Automates moving overdue Deck cards between stacks, configurable per user.", "description": "Automates moving overdue Deck cards between stacks, configurable per user.",