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 workflow template for recurring cancelled #21611

Merged
merged 1 commit into from
Dec 21, 2021

Conversation

eileenmcnaughton
Copy link
Contributor

@eileenmcnaughton eileenmcnaughton commented Sep 25, 2021

Overview

Add workflow template for recurring cancelled

Before

No workflow template class

After

Tada

Technical Details

This is a simple template, with a slightly smaller subset of values than the exisiting one.

It pulls out the recurring part to a trait... I think we want to also create similar traits for Contribuiton messages - which was going to be my next focus.

Comments

Test pre-added to CancelSubscriptionTest class testing these values

@civibot
Copy link

civibot bot commented Sep 25, 2021

(Standard links)

@eileenmcnaughton
Copy link
Contributor Author

test this please

@eileenmcnaughton
Copy link
Contributor Author

test this please

protected function exportExtraTokenContext(array &$export): void {
$export['smartyTokenAlias']['installments'] = 'contribution_recur.installments';
$export['smartyTokenAlias']['amount'] = 'contribution_recur.amount';
$export['smartyTokenAlias']['recur_frequency_unit'] = 'contribution_recur.frequency_unit';
$export['smartyTokenAlias']['recur_frequency_unit'] = 'contribution_recur.frequency_unit:label';
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@totten I think without this change ^^ we will have a regression in 5.43 around translation of 'year' - I saw it on one of your screenshots

@eileenmcnaughton
Copy link
Contributor Author

@colemanw @seamuslee001 @demeritcowboy any of you OK to merge this? I'd like to add a trait for the contribution ones (already have for participant) & maybe membership so tokens for the base entity are available

This is a simple template, with a slightly smaller subset of values than the exisiting one.

It pulls out the recurring part to a trait...
@eileenmcnaughton
Copy link
Contributor Author

@seamuslee001 @colemanw @demeritcowboy is this one one of you could look at? It doesn't have the 'has-test' label because I got the tests merged prior to this PR but the change is covered by a unit test.

@demeritcowboy
Copy link
Contributor

I've taken a little look it's just an area I rarely deal with. Codewise it looks ok but I'd want to run it which I can try. It looks like this is supporting two templates, for memberships and contributions.

@seamuslee001
Copy link
Contributor

I agree with @demeritcowboy on the code structure and we have a decent amount of tests that cover this so I am ok to merge on that basis

@seamuslee001 seamuslee001 merged commit b0ea619 into civicrm:master Dec 21, 2021
@seamuslee001 seamuslee001 deleted the cancel branch December 21, 2021 04:49
@eileenmcnaughton
Copy link
Contributor Author

thanks @seamuslee001 @demeritcowboy - yeah this new code is gonna take us all a bit of getting into

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