Return the sendEmail function to it's owner
authorEileen McNaughton <emcnaughton@wikimedia.org>
Fri, 24 Sep 2021 21:13:14 +0000 (09:13 +1200)
committerEileen McNaughton <emcnaughton@wikimedia.org>
Fri, 24 Sep 2021 21:13:14 +0000 (09:13 +1200)
commit7e27588cdcfc1f9ff03eb978f3f73cde1ed0ca5a
tree7b8414e4af54ca2bb7a97521f9a0232f23a6763a
parent2f063046be11cd58e07a0494856d529fd3613fbe
Return the sendEmail function to it's owner

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
- membership & participant - but the business of 'one email per person, &
just grab the tokens from the last entity' is messing with
my head a bit. That's the next bit....
CRM/Activity/BAO/Activity.php
CRM/Contact/Form/Task/EmailTrait.php
CRM/Core/BAO/File.php
tests/phpunit/CRM/Activity/BAO/ActivityTest.php