Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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,121 @@
START TRANSACTION;

-- ZMSKVR-352: Formatierung der Standard-E-Mail-Templates
--
-- - Leistungen (Service-Links) nicht mehr bold
-- - Trennstriche einheitlich als einzelner Geviertstrich (—)
-- Live-Templates nutzen je nach Umgebung —— (doppelter Geviertstrich)
-- ODER --- (drei ASCII-Bindestriche); beides wird hier abgedeckt.
-- - Abstände um Trennstriche / unter "Termin aktivieren" reduzieren
--
-- REGEXP_REPLACE, damit Einrückung, CRLF/LF und optionale Leerzeilen
-- die Ersetzung nicht verhindern (das war der Fehlschlag auf zms-dev).
-- Idempotent: bereits umgestellte Templates bleiben unverändert.
--
-- Betrifft mail_confirmation, mail_preconfirmed und mail_reminder
-- (global + customized). Lange Alt-Trenner (----------------------)
-- bleiben unangetastet.

-- 1) Leistungen: <strong> um Service-Links entfernen (beliebige href)
UPDATE `mailtemplate`
SET `value` = REGEXP_REPLACE(
`value`,
'<strong>[[:space:]]*<a href="([^"]+)">[[:space:]]*(\\{\\{ requestGroup\\[''request''\\]\\.name \\}\\})[[:space:]]*</a>[[:space:]]*</strong>',
'<a href="\\1">\\2 </a>'
)
WHERE `name` IN (
'mail_confirmation.twig',
'mail_preconfirmed.twig',
'mail_reminder.twig'
)
AND `value` REGEXP '<strong>[[:space:]]*<a href="[^"]+">[[:space:]]*\\{\\{ requestGroup\\[''request''\\]\\.name';

-- 2) Trennlinie aus genau drei ASCII-Bindestrichen → Geviertstrich
-- (nur ganze Zeile, nicht Teil von ----------------------)
UPDATE `mailtemplate`
SET `value` = REGEXP_REPLACE(
`value`,
CONCAT(
'(', CHAR(13), CHAR(10), '|', CHAR(10), ')',
'([[:blank:]]*)---([[:blank:]]*)',
'(', CHAR(13), CHAR(10), '|', CHAR(10), ')'
),
CONCAT('\\1', '\\2', '—', '\\3', '\\4')
)
WHERE `name` IN (
'mail_confirmation.twig',
'mail_preconfirmed.twig',
'mail_reminder.twig'
)
AND `value` REGEXP CONCAT(
'(', CHAR(13), CHAR(10), '|', CHAR(10), ')',
'[[:blank:]]*---[[:blank:]]*',
'(', CHAR(13), CHAR(10), '|', CHAR(10), ')'
);

-- 3) Trennlinie aus doppeltem Geviertstrich → einzelner Geviertstrich
UPDATE `mailtemplate`
SET `value` = REGEXP_REPLACE(
`value`,
CONCAT(
'(', CHAR(13), CHAR(10), '|', CHAR(10), ')',
'([[:blank:]]*)——([[:blank:]]*)',
'(', CHAR(13), CHAR(10), '|', CHAR(10), ')'
),
CONCAT('\\1', '\\2', '—', '\\3', '\\4')
)
WHERE `name` IN (
'mail_confirmation.twig',
'mail_preconfirmed.twig',
'mail_reminder.twig'
)
AND `value` LIKE '%——%';

-- 4) <br><br> / extra Leerzeilen um den Geviertstrich → je ein <br>
UPDATE `mailtemplate`
SET `value` = REGEXP_REPLACE(
`value`,
CONCAT(
'<br[[:space:]]*/?>',
'([[:space:]]*<br[[:space:]]*/?>)?',
'(', CHAR(13), CHAR(10), '|', CHAR(10), ')+',
'([[:blank:]]*)—([[:blank:]]*)',
'(', CHAR(13), CHAR(10), '|', CHAR(10), ')+',
'([[:blank:]]*)<br[[:space:]]*/?>',
'([[:space:]]*<br[[:space:]]*/?>)?'
),
CONCAT('<br>', CHAR(13), CHAR(10), '\\3—\\4', CHAR(13), CHAR(10), '\\6<br>')
)
WHERE `name` IN (
'mail_confirmation.twig',
'mail_preconfirmed.twig',
'mail_reminder.twig'
)
AND `value` LIKE '%—%'
AND (
`value` LIKE '%<br><br>%—%'
OR `value` LIKE '%—%<br><br>%'
OR `value` LIKE '%<br /><br />%—%'
);
Comment thread
ThomasAFink marked this conversation as resolved.

-- 5) Abstand unter "Termin aktivieren" reduzieren
UPDATE `mailtemplate`
SET `value` = REGEXP_REPLACE(
`value`,
'Termin aktivieren</a></strong>[[:space:]]*<br[[:space:]]*/?>([[:space:]]*<br[[:space:]]*/?>)?',
CONCAT('Termin aktivieren</a></strong>', CHAR(13), CHAR(10), '<br>')
)
WHERE `name` = 'mail_preconfirmed.twig'
AND `value` LIKE '%Termin aktivieren%</strong>%<br%';

-- 6) Catch-all: verbleibender doppelter Geviertstrich (nicht zeilenweise)
UPDATE `mailtemplate`
SET `value` = REPLACE(`value`, '——', '—')
WHERE `name` IN (
'mail_confirmation.twig',
'mail_preconfirmed.twig',
'mail_reminder.twig'
)
AND `value` LIKE '%——%';

COMMIT;
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
START TRANSACTION;

-- ZMSKVR-352 follow-up: zms-dev (and any env that already applied
-- 91785035201) still showed ASCII-hyphen separators (---) and the old
-- <br><br> spacing. The first migration only matched double em-dashes (——).
--
-- Same transforms as the updated 91785035201; idempotent so later
-- environments that run both files are unchanged the second time.

-- 1) Leistungen: <strong> um Service-Links entfernen (beliebige href)
UPDATE `mailtemplate`
SET `value` = REGEXP_REPLACE(
`value`,
'<strong>[[:space:]]*<a href="([^"]+)">[[:space:]]*(\\{\\{ requestGroup\\[''request''\\]\\.name \\}\\})[[:space:]]*</a>[[:space:]]*</strong>',
'<a href="\\1">\\2 </a>'
)
WHERE `name` IN (
'mail_confirmation.twig',
'mail_preconfirmed.twig',
'mail_reminder.twig'
)
AND `value` REGEXP '<strong>[[:space:]]*<a href="[^"]+">[[:space:]]*\\{\\{ requestGroup\\[''request''\\]\\.name';

-- 2) Trennlinie aus genau drei ASCII-Bindestrichen → Geviertstrich
UPDATE `mailtemplate`
SET `value` = REGEXP_REPLACE(
`value`,
CONCAT(
'(', CHAR(13), CHAR(10), '|', CHAR(10), ')',
'([[:blank:]]*)---([[:blank:]]*)',
'(', CHAR(13), CHAR(10), '|', CHAR(10), ')'
),
CONCAT('\\1', '\\2', '—', '\\3', '\\4')
)
WHERE `name` IN (
'mail_confirmation.twig',
'mail_preconfirmed.twig',
'mail_reminder.twig'
)
AND `value` REGEXP CONCAT(
'(', CHAR(13), CHAR(10), '|', CHAR(10), ')',
'[[:blank:]]*---[[:blank:]]*',
'(', CHAR(13), CHAR(10), '|', CHAR(10), ')'
);

-- 3) Trennlinie aus doppeltem Geviertstrich → einzelner Geviertstrich
UPDATE `mailtemplate`
SET `value` = REGEXP_REPLACE(
`value`,
CONCAT(
'(', CHAR(13), CHAR(10), '|', CHAR(10), ')',
'([[:blank:]]*)——([[:blank:]]*)',
'(', CHAR(13), CHAR(10), '|', CHAR(10), ')'
),
CONCAT('\\1', '\\2', '—', '\\3', '\\4')
)
WHERE `name` IN (
'mail_confirmation.twig',
'mail_preconfirmed.twig',
'mail_reminder.twig'
)
AND `value` LIKE '%——%';

-- 4) <br><br> / extra Leerzeilen um den Geviertstrich → je ein <br>
UPDATE `mailtemplate`
SET `value` = REGEXP_REPLACE(
`value`,
CONCAT(
'<br[[:space:]]*/?>',
'([[:space:]]*<br[[:space:]]*/?>)?',
'(', CHAR(13), CHAR(10), '|', CHAR(10), ')+',
'([[:blank:]]*)—([[:blank:]]*)',
'(', CHAR(13), CHAR(10), '|', CHAR(10), ')+',
'([[:blank:]]*)<br[[:space:]]*/?>',
'([[:space:]]*<br[[:space:]]*/?>)?'
),
CONCAT('<br>', CHAR(13), CHAR(10), '\\3—\\4', CHAR(13), CHAR(10), '\\6<br>')
)
WHERE `name` IN (
'mail_confirmation.twig',
'mail_preconfirmed.twig',
'mail_reminder.twig'
)
AND `value` LIKE '%—%'
AND (
`value` LIKE '%<br><br>%—%'
OR `value` LIKE '%—%<br><br>%'
OR `value` LIKE '%<br /><br />%—%'
);

-- 5) Abstand unter "Termin aktivieren" reduzieren
UPDATE `mailtemplate`
SET `value` = REGEXP_REPLACE(
`value`,
'Termin aktivieren</a></strong>[[:space:]]*<br[[:space:]]*/?>([[:space:]]*<br[[:space:]]*/?>)?',
CONCAT('Termin aktivieren</a></strong>', CHAR(13), CHAR(10), '<br>')
)
WHERE `name` = 'mail_preconfirmed.twig'
AND `value` LIKE '%Termin aktivieren%</strong>%<br%';

-- 6) Catch-all: verbleibender doppelter Geviertstrich
UPDATE `mailtemplate`
SET `value` = REPLACE(`value`, '——', '—')
WHERE `name` IN (
'mail_confirmation.twig',
'mail_preconfirmed.twig',
'mail_reminder.twig'
)
AND `value` LIKE '%——%';

COMMIT;
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
START TRANSACTION;

-- ZMSKVR-352 follow-up: use a double Geviertstrich with two <br> on each side:
-- a double Geviertstrich with two <br> on each side:
--
-- <br><br>
-- ——
-- <br><br>
--
-- 91785035201/35202 already ran on some envs and left a single — with one
-- <br>. A lone —— can also wrap onto two lines in some clients, so wrap it
-- in nowrap. Idempotent: the canonical block matches itself.
--
-- Does not touch long ASCII rules (----------------------).

-- Standalone separator line (—, ——, ---, optional nowrap span) plus any
-- surrounding <br> tags → canonical two-break nowrap double Geviertstrich.
UPDATE `mailtemplate`
SET `value` = REGEXP_REPLACE(
`value`,
CONCAT(
'(<br[[:space:]]*/?>[[:space:]]*)*',
'(', CHAR(13), CHAR(10), '|', CHAR(10), ')+',
'[[:blank:]]*(<span style="white-space:nowrap">)?(——|—|---)(</span>)?[[:blank:]]*',
'(', CHAR(13), CHAR(10), '|', CHAR(10), ')+',
'([[:blank:]]*<br[[:space:]]*/?>[[:space:]]*)*'
),
CONCAT(
'<br><br>',
CHAR(13), CHAR(10),
'<span style="white-space:nowrap">——</span>',
Comment thread
ThomasAFink marked this conversation as resolved.
CHAR(13), CHAR(10),
'<br><br>'
)
)
WHERE `name` IN (
'mail_confirmation.twig',
'mail_preconfirmed.twig',
'mail_reminder.twig'
)
AND `value` REGEXP CONCAT(
'(', CHAR(13), CHAR(10), '|', CHAR(10), ')',
'[[:blank:]]*(<span style="white-space:nowrap">)?(——|—|---)(</span>)?[[:blank:]]*',
'(', CHAR(13), CHAR(10), '|', CHAR(10), ')'
);

COMMIT;
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
START TRANSACTION;

-- ZMSKVR-352 follow-up: remaining mail templates still use mixed
-- standalone separator lines that 91785035203 did not cover:
--
-- <br><br> (mail_delete.twig)
-- —
-- <br><br>
--
-- <br><br> (mail_delete.twig)
-- ---
-- <br><br>
--
-- <br /><br /> (mail_queued.twig and customized
-- ---------------------- mail_confirmation.twig; indented)
-- <br /><br />
--
-- 35203 only matched (——|—|---) on confirmation/preconfirmed/reminder,
-- so long ASCII rules and delete/queued copies were left behind.
-- mail_admin_delete.twig is included so customized copies with dashes
-- are converted too (current dump rows have none).
--
-- Same canonical block as 91785035203. Idempotent: that block matches
-- itself. Standalone line only (newline-bounded), so hyphens inside
-- URLs are not touched.
--
-- Dash forms (longer first; no —+ because MariaDB REGEXP is byte-based):
-- —— double Geviertstrich
-- — single Geviertstrich
-- -{3,} ---, ----------------------, and any longer ASCII rule
-- –– double Halbgeviertstrich
-- – single Halbgeviertstrich

UPDATE `mailtemplate`
SET `value` = REGEXP_REPLACE(
`value`,
CONCAT(
'(<br[[:space:]]*/?>[[:space:]]*)*',
'(', CHAR(13), CHAR(10), '|', CHAR(10), ')+',
'[[:blank:]]*(<span style="white-space:nowrap">)?(——|—|-{3,}|––|–)(</span>)?[[:blank:]]*',
'(', CHAR(13), CHAR(10), '|', CHAR(10), ')+',
'([[:blank:]]*<br[[:space:]]*/?>[[:space:]]*)*'
),
CONCAT(
'<br><br>',
CHAR(13), CHAR(10),
'<span style="white-space:nowrap">——</span>',
CHAR(13), CHAR(10),
'<br><br>'
)
)
WHERE `name` IN (
'mail_confirmation.twig',
'mail_preconfirmed.twig',
'mail_reminder.twig',
'mail_delete.twig',
'mail_admin_delete.twig',
'mail_queued.twig'
)
AND `value` REGEXP CONCAT(
'(', CHAR(13), CHAR(10), '|', CHAR(10), ')',
'[[:blank:]]*(<span style="white-space:nowrap">)?(——|—|-{3,}|––|–)(</span>)?[[:blank:]]*',
'(', CHAR(13), CHAR(10), '|', CHAR(10), ')'
);

COMMIT;
Loading
Loading