Add workflow_name column to civicrm_msg_template, deprecate workflow_id #17227
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
Alternate to #17180
Some "Message Templates" are associated with workflow steps -- e.g. if a message template is associated with "membership_online_receipt", then it will be sent as the automated email after someone signs up for a membership online. This PR makes the association easier to work with.
Before
The relationship between "Message Template" and "Workflow" is tracked by the column
civicrm_msg_template
.workflow_id
.The column
workflow_id
is encoded in an unusual/confusing way -- it referencescivicrm_option_value
.id
. A column like this should normally referencecivicrm_option_value
.value
or perhapscivicrm_option_value
.name
- but the COV ID is unusual and tricky to work with.After
The relationship is also tracked by the column
civicrm_msg_template
.workflow_name
. This is a symbolic value referring tocivicrm_option_value
.name
.The
workflow_id
still works but is deprecated.Technical Details
Alternate to #17180 per feedback from @mattwire & @totten
Comments
Note that this leaves open the question of adding an option group for this field as something we can do - but don't have to