Skip to content

Instantly share code, notes, and snippets.

@ginkgomzd
Created September 4, 2019 13:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ginkgomzd/b946082646793f7475272e07b4efb874 to your computer and use it in GitHub Desktop.
Save ginkgomzd/b946082646793f7475272e07b4efb874 to your computer and use it in GitHub Desktop.
List Modified System Workflow Msg Templates
SELECT
og.name,
ov.id, ov.name, ov.label
FROM
civicrm_msg_template tpl
INNER JOIN
civicrm_msg_template r -- reserved tpls
ON r.is_reserved = 1 AND r.is_default = 0
AND tpl.is_default = 1 AND tpl.is_reserved = 0
AND r.workflow_id = tpl.workflow_id
LEFT JOIN
civicrm_option_value ov ON tpl.workflow_id = ov.id
LEFT JOIN
civicrm_option_group og ON ov.option_group_id = og.id
WHERE
tpl.is_active = 1
AND ( tpl.msg_text != r.msg_text OR tpl.msg_html != r.msg_html OR tpl.msg_subject != r.msg_subject)
ORDER BY og.name, ov.id
;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment