Skip to content
Snippets Groups Projects
Commit e2e74928 authored by sv's avatar sv Committed by Taras Kruts
Browse files

Issue #3380523 by SV: Adjust all references of getCtaButton() method

parent b7397387
No related branches found
No related tags found
No related merge requests found
Showing
with 14 additions and 14 deletions
......@@ -78,7 +78,7 @@ function social_activity_tokens($type, $tokens, array $data, array $options, Bub
$preview_info = $email_token_services->getPostPreview($entity);
// Prepare CTA button information.
$cta_button = $email_token_services->getCtaButton($link, new TranslatableMarkup('Leave a comment'));
$cta_button = $email_token_services->getCtaButton($link, new TranslatableMarkup('Leave a comment', [], $options));
// This is for token deprecated token 'additional_information'.
$additional_information = [
......@@ -99,7 +99,7 @@ function social_activity_tokens($type, $tokens, array $data, array $options, Bub
$link = $node->toUrl('canonical', ['absolute' => TRUE]);
// Prepare the CTA button markup.
$cta_button = $email_token_services->getCtaButton($link, new TranslatableMarkup('Read more'));
$cta_button = $email_token_services->getCtaButton($link, new TranslatableMarkup('Read more', [], $options));
// This is for token deprecated token 'additional_information'.
$additional_information = [
......
......@@ -285,7 +285,7 @@ function social_comment_tokens_alter(array &$replacements, array $context, Bubbl
/** @var \Drupal\Core\Entity\EntityInterface $commented_entity */
$link = $commented_entity->toUrl('canonical', ['absolute' => TRUE, 'fragment' => 'comment-' . $comment->id()]);
$cta_button = $email_token_services->getCtaButton($link, new TranslatableMarkup('Reply to this comment'));
$cta_button = $email_token_services->getCtaButton($link, new TranslatableMarkup('Reply to this comment', [], $context['options']));
$replacements[$context['tokens']['cta_button']] = \Drupal::service('renderer')->renderPlain($cta_button);
}
......
......@@ -100,7 +100,7 @@ function social_content_report_tokens_alter(array &$replacements, array $context
// Replace the preview token.
if (isset($context['tokens']['cta_button'])) {
$link = Url::fromRoute('view.report_overview.overview');
$cta_button = $email_token_services->getCtaButton($link, new TranslatableMarkup('Check the reported contents'));
$cta_button = $email_token_services->getCtaButton($link, new TranslatableMarkup('Check the reported contents', [], $context['options']));
$replacements[$context['tokens']['cta_button']] = \Drupal::service('renderer')->renderPlain($cta_button);
}
......
......@@ -119,14 +119,14 @@ function social_event_tokens_alter(array &$replacements, array $context, Bubblea
switch ($message_template_id) {
case 'activity_on_events_im_organizing':
$link = Url::fromRoute('view.event_manage_enrollments.page_manage_enrollments', ['node' => $event->id()]);
$cta_button = $email_token_services->getCtaButton($link, new TranslatableMarkup('View enrollments'));
$cta_button = $email_token_services->getCtaButton($link, new TranslatableMarkup('View enrollments', [], $context['options']));
$replacements[$context['tokens']['cta_button']] = \Drupal::service('renderer')
->renderPlain($cta_button);
break;
case 'request_event_enrollment':
$link = Url::fromRoute('view.event_manage_enrollment_requests.page_manage_enrollment_requests', ['node' => $event->id()]);
$cta_button = $email_token_services->getCtaButton($link, new TranslatableMarkup('View enrollment requests'));
$cta_button = $email_token_services->getCtaButton($link, new TranslatableMarkup('View enrollment requests', [], $context['options']));
$replacements[$context['tokens']['cta_button']] = \Drupal::service('renderer')
->renderPlain($cta_button);
break;
......@@ -134,14 +134,14 @@ function social_event_tokens_alter(array &$replacements, array $context, Bubblea
case 'member_added_by_event_organiser':
case 'event_request_approved':
$link = $event->toUrl('canonical');
$cta_button = $email_token_services->getCtaButton($link, new TranslatableMarkup('See the event'));
$cta_button = $email_token_services->getCtaButton($link, new TranslatableMarkup('See the event', [], $context['options']));
$replacements[$context['tokens']['cta_button']] = \Drupal::service('renderer')
->renderPlain($cta_button);
break;
case 'user_was_enrolled_to_event':
$link = $event->toUrl();
$cta_button = $email_token_services->getCtaButton($link, new TranslatableMarkup('See event details'));
$cta_button = $email_token_services->getCtaButton($link, new TranslatableMarkup('See event details', [], $context['options']));
$replacements[$context['tokens']['cta_button']] = \Drupal::service('renderer')
->renderPlain($cta_button);
break;
......
......@@ -212,7 +212,7 @@ function social_follow_taxonomy_tokens_alter(array &$replacements, array $contex
case 'update_node_following_tag':
if (isset($context['tokens']['cta_button'])) {
$link = $entity->toUrl('canonical', ['absolute' => TRUE]);
$cta_button = $email_token_services->getCtaButton($link, new TranslatableMarkup('Read more about it'));
$cta_button = $email_token_services->getCtaButton($link, new TranslatableMarkup('Read more about it', [], $context['options']));
$replacements[$context['tokens']['cta_button']] = \Drupal::service('renderer')
->renderPlain($cta_button);
}
......
......@@ -98,7 +98,7 @@ function social_group_request_tokens_alter(array &$replacements, array $context,
if (isset($context['tokens']['cta_button'])) {
$link = Url::fromRoute('view.group_pending_members.membership_requests', ['arg_0' => $group->id()],
['absolute' => TRUE]);
$cta_button = $email_token_services->getCtaButton($link, new TranslatableMarkup('View the requests'));
$cta_button = $email_token_services->getCtaButton($link, new TranslatableMarkup('View the requests', [], $context['options']));
$replacements[$context['tokens']['cta_button']] = \Drupal::service('renderer')
->renderPlain($cta_button);
}
......
......@@ -176,7 +176,7 @@ function social_group_tokens_alter(array &$replacements, array $context, Bubblea
switch ($message_template_id) {
case 'approve_request_join_group':
if (isset($context['tokens']['cta_button'])) {
$cta_button = $email_token_services->getCtaButton($link, new TranslatableMarkup('Explore the group'));
$cta_button = $email_token_services->getCtaButton($link, new TranslatableMarkup('Explore the group', [], $context['options']));
$replacements[$context['tokens']['cta_button']] = \Drupal::service('renderer')
->renderPlain($cta_button);
}
......
......@@ -177,7 +177,7 @@ function social_like_tokens_alter(array &$replacements, array $context, Bubbleab
$commented_entity = $voted_entity->getCommentedEntity();
$link = $commented_entity->toUrl('canonical', $url_options);
}
$cta_button = $email_token_services->getCtaButton($link, new TranslatableMarkup('See all likes'));
$cta_button = $email_token_services->getCtaButton($link, new TranslatableMarkup('See all likes', [], $context['options']));
$replacements[$context['tokens']['cta_button']] = \Drupal::service('renderer')
->renderPlain($cta_button);
}
......
......@@ -240,7 +240,7 @@ function social_mentions_tokens_alter(array &$replacements, array $context, Bubb
}
$link = $entity->toUrl('canonical', $options);
$cta_button = $email_token_services->getCtaButton($link, new TranslatableMarkup('Reply to this comment'));
$cta_button = $email_token_services->getCtaButton($link, new TranslatableMarkup('Reply to this comment', [], $context['options']));
$replacements[$context['tokens']['cta_button']] = \Drupal::service('renderer')
->renderPlain($cta_button);
}
......
......@@ -43,7 +43,7 @@ function social_private_message_tokens_alter(array &$replacements, array $contex
['private_message_thread' => $thread_id],
['absolute' => TRUE]
);
$cta_button = $email_token_services->getCtaButton($thread_url, new TranslatableMarkup('Reply to this message'));
$cta_button = $email_token_services->getCtaButton($thread_url, new TranslatableMarkup('Reply to this message', [], $context['options']));
if (!empty($cta_button)) {
$replacements[$context['tokens']['cta_button']] = \Drupal::service('renderer')->renderPlain($cta_button);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment