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
b9f2127b
Commit
b9f2127b
authored
2 years ago
by
ufundo
Browse files
Options
Downloads
Patches
Plain Diff
#3463
- CiviMail - prefer frontend_title from group for mailing.group token
parent
2648645c
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/Mailing/BAO/Mailing.php
+16
-13
16 additions, 13 deletions
CRM/Mailing/BAO/Mailing.php
with
16 additions
and
13 deletions
CRM/Mailing/BAO/Mailing.php
+
16
−
13
View file @
b9f2127b
...
...
@@ -1419,22 +1419,25 @@ ORDER BY civicrm_email.is_bulkmail DESC
if
(
!
isset
(
$this
->
id
))
{
return
[];
}
$mg
=
new
CRM_Mailing_DAO_MailingGroup
();
$mgtable
=
CRM_Mailing_DAO_MailingGroup
::
getTableName
();
$group
=
CRM_Contact_BAO_Group
::
getTableName
();
$mg
->
query
(
"SELECT
$group
.title as name FROM
$mgtable
INNER JOIN
$group
ON
$mgtable
.entity_id =
$group
.id
WHERE
$mgtable
.mailing_id =
{
$this
->
id
}
AND
$mgtable
.entity_table = '
$group
'
AND
$mgtable
.group_type = 'Include'
ORDER BY
$group
.name"
);
$mailingGroups
=
\Civi\Api4\MailingGroup
::
get
()
->
addSelect
(
'group.title'
,
'group.frontend_title'
)
->
addJoin
(
'Group AS group'
,
'LEFT'
,
[
'entity_id'
,
'='
,
'group.id'
])
->
addWhere
(
'mailing_id'
,
'='
,
$this
->
id
)
->
addWhere
(
'entity_table'
,
'='
,
'civicrm_group'
)
->
addWhere
(
'group_type'
,
'='
,
'Include'
)
->
execute
();
$groupNames
=
[];
$groups
=
[];
while
(
$mg
->
fetch
())
{
$groups
[]
=
$mg
->
name
;
foreach
(
$mailingGroups
as
$mg
)
{
$name
=
$mg
[
'group.frontend_title'
]
??
$mg
[
'group.title'
];
if
(
$name
)
{
$groupNames
[]
=
$name
;
}
}
return
$groups
;
return
$groupNames
;
}
/**
...
...
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