Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
CiviCRM Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Development
CiviCRM Core
Commits
efb4a265
Commit
efb4a265
authored
4 years ago
by
eileen
Browse files
Options
Downloads
Patches
Plain Diff
[REF] Move code closer to where it is used
Simply moves a few lines of code so the actual usage is apparent
parent
36c2072c
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
CRM/Core/BAO/MessageTemplate.php
+4
-3
4 additions, 3 deletions
CRM/Core/BAO/MessageTemplate.php
with
4 additions
and
3 deletions
CRM/Core/BAO/MessageTemplate.php
+
4
−
3
View file @
efb4a265
...
...
@@ -471,14 +471,12 @@ class CRM_Core_BAO_MessageTemplate extends CRM_Core_DAO_MessageTemplate {
// replace tokens in the three elements (in subject as if it was the text body)
$domain
=
CRM_Core_BAO_Domain
::
getDomain
();
$hookTokens
=
[];
$mailing
=
new
CRM_Mailing_BAO_Mailing
();
$mailing
->
subject
=
$mailContent
[
'subject'
];
$mailing
->
body_text
=
$mailContent
[
'text'
];
$mailing
->
body_html
=
$mailContent
[
'html'
];
$tokens
=
$mailing
->
getTokens
();
CRM_Utils_Hook
::
tokens
(
$hookTokens
);
$categories
=
array_keys
(
$hookTokens
);
$contactID
=
$params
[
'contactId'
]
??
NULL
;
...
...
@@ -540,6 +538,9 @@ class CRM_Core_BAO_MessageTemplate extends CRM_Core_DAO_MessageTemplate {
);
$contact
=
$contactArray
[
$contactID
];
$hookTokens
=
[];
CRM_Utils_Hook
::
tokens
(
$hookTokens
);
$categories
=
array_keys
(
$hookTokens
);
$mailContent
[
'subject'
]
=
CRM_Utils_Token
::
replaceHookTokens
(
$mailContent
[
'subject'
],
$contact
,
$categories
,
TRUE
);
$mailContent
[
'text'
]
=
CRM_Utils_Token
::
replaceHookTokens
(
$mailContent
[
'text'
],
$contact
,
$categories
,
TRUE
);
$mailContent
[
'html'
]
=
CRM_Utils_Token
::
replaceHookTokens
(
$mailContent
[
'html'
],
$contact
,
$categories
,
TRUE
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment