[REF] Return the sendEmail function to it's owner #21608
Merged
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
[REF] Return the sendEmail function to it's owner
Before
Function to send emails from the Email task is on the activity BAO - giving the illusion of being centralised, re-usable code
After
The function on the BAO is deprecated. The real function now lives on the email trait, permitting us to clean up the inputs & outputs in follow ups
Technical Details
This sendEmail function is only called from one place in core and it is not 'generally useful' having
an awful parameter set. This PR moves it back to the class that 'owns' it - which will
allow us to undo all the work of building up that parameter set
and make it possible to support tokens for other entities than those already mangled in.
I would normally add a noisy deprecation notice once a function becomes unused in
core but since that has been done to the pdf task this release I've left this
deprecation a bit quieter for now.
Note that I cleaned up the tokens handled here before deprecating so we
could get rid of those calls fully
Under the OO structure it becomes easier to add the missing token options
just grab the tokens from the last entity' is messing with
my head a bit. That's the next bit....
Comments
@demeritcowboy @seamuslee001 @colemanw this one really is a straight copy so should be easy to confirm