Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add upgrade to replace legacy contribution tokens from message templates #21605

Merged
merged 2 commits into from
Sep 26, 2021

Conversation

eileenmcnaughton
Copy link
Contributor

Overview

Add upgrade to replace legacy contribution tokens from message templates

Before

People with saved templates with the old values would need to manually fix them before using them to create a pdf of send an email

After

DB updated automatically

Technical Details

Under legacy token replacement these 4 work
contribution.contribution_status
contribution.contribution_status_id:label
contribution.campaign
contribution.campaign_id:label

But only the label ones work with the processor. This upgrades the
old ones our of the message templates table

Comments

@demeritcowboy

…ates

Under legacy token replacement these 4 work
contribution.contribution_status
contribution.contribution_status_id:label
contribution.campaign
contribution.campaign_id:label

But only the label ones work with the processor. This upgrades the
    old ones our of the message templates table
@civibot
Copy link

civibot bot commented Sep 24, 2021

(Standard links)

@demeritcowboy
Copy link
Contributor

Easiest review ever ... no file changes! ... merge-on-pass.
He he...

@eileenmcnaughton
Copy link
Contributor Author

Argh - that commit got so broke!

@eileenmcnaughton
Copy link
Contributor Author

OK - I think now...

@eileenmcnaughton
Copy link
Contributor Author

@demeritcowboy should be OK now

@demeritcowboy
Copy link
Contributor

I admit I'm getting confused by all the different contexts but think I have this one straight now.

Ok so non-workflow templates, e.g. used for Find Contributions - Send Email: Good.

For workflow, the upgrade doesn't replace them but you can't use these tokens in workflow templates anyway, because it doesn't have the context and needs to get the data from smarty variables. Although when you do use them, e.g. in the offline receipt template and by choosing send receipt when you make a contribution, it seems to know enough to recognize them as tokens in the sense it "replaces" them, but they are replaced by blanks, instead of outputting a literal {contribution.X}.

@demeritcowboy demeritcowboy merged commit 142d11a into civicrm:master Sep 26, 2021
@eileenmcnaughton eileenmcnaughton deleted the gen_up branch September 26, 2021 18:50
@eileenmcnaughton
Copy link
Contributor Author

eileenmcnaughton commented Sep 26, 2021

@demeritcowboy yeah I'm starting to look at the workflow templates a little - eg. here #21611 & that converts them to allowing tokens - in that case contribution recur (the example data config is missing there though I think - which only matters for preview mode in the new message admin)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants