You are here

public static function EmailActivityDestination::getSendEmailOutputText in Open Social 8.5

Same name and namespace in other branches
  1. 8.9 modules/custom/activity_send/modules/activity_send_email/src/Plugin/ActivityDestination/EmailActivityDestination.php \Drupal\activity_send_email\Plugin\ActivityDestination\EmailActivityDestination::getSendEmailOutputText()
  2. 8 modules/custom/activity_send/modules/activity_send_email/src/Plugin/ActivityDestination/EmailActivityDestination.php \Drupal\activity_send_email\Plugin\ActivityDestination\EmailActivityDestination::getSendEmailOutputText()
  3. 8.2 modules/custom/activity_send/modules/activity_send_email/src/Plugin/ActivityDestination/EmailActivityDestination.php \Drupal\activity_send_email\Plugin\ActivityDestination\EmailActivityDestination::getSendEmailOutputText()
  4. 8.3 modules/custom/activity_send/modules/activity_send_email/src/Plugin/ActivityDestination/EmailActivityDestination.php \Drupal\activity_send_email\Plugin\ActivityDestination\EmailActivityDestination::getSendEmailOutputText()
  5. 8.4 modules/custom/activity_send/modules/activity_send_email/src/Plugin/ActivityDestination/EmailActivityDestination.php \Drupal\activity_send_email\Plugin\ActivityDestination\EmailActivityDestination::getSendEmailOutputText()
  6. 8.6 modules/custom/activity_send/modules/activity_send_email/src/Plugin/ActivityDestination/EmailActivityDestination.php \Drupal\activity_send_email\Plugin\ActivityDestination\EmailActivityDestination::getSendEmailOutputText()
  7. 8.7 modules/custom/activity_send/modules/activity_send_email/src/Plugin/ActivityDestination/EmailActivityDestination.php \Drupal\activity_send_email\Plugin\ActivityDestination\EmailActivityDestination::getSendEmailOutputText()
  8. 8.8 modules/custom/activity_send/modules/activity_send_email/src/Plugin/ActivityDestination/EmailActivityDestination.php \Drupal\activity_send_email\Plugin\ActivityDestination\EmailActivityDestination::getSendEmailOutputText()
  9. 10.3.x modules/custom/activity_send/modules/activity_send_email/src/Plugin/ActivityDestination/EmailActivityDestination.php \Drupal\activity_send_email\Plugin\ActivityDestination\EmailActivityDestination::getSendEmailOutputText()
  10. 10.0.x modules/custom/activity_send/modules/activity_send_email/src/Plugin/ActivityDestination/EmailActivityDestination.php \Drupal\activity_send_email\Plugin\ActivityDestination\EmailActivityDestination::getSendEmailOutputText()
  11. 10.1.x modules/custom/activity_send/modules/activity_send_email/src/Plugin/ActivityDestination/EmailActivityDestination.php \Drupal\activity_send_email\Plugin\ActivityDestination\EmailActivityDestination::getSendEmailOutputText()
  12. 10.2.x modules/custom/activity_send/modules/activity_send_email/src/Plugin/ActivityDestination/EmailActivityDestination.php \Drupal\activity_send_email\Plugin\ActivityDestination\EmailActivityDestination::getSendEmailOutputText()

Get field value for 'output_text' field from data array.

Parameters

\Drupal\message\Entity\Message $message: The Message object.

string $langcode: The language in which we need to get the email text.

Return value

string|null If we have message text we return the text, otherwise null.

2 calls to EmailActivityDestination::getSendEmailOutputText()
ActivityDigestWorker::processItem in modules/custom/activity_send/modules/activity_send_email/src/Plugin/QueueWorker/ActivityDigestWorker.php
Works on a single queue item.
Immediately::processItem in modules/custom/activity_send/modules/activity_send_email/src/Plugin/EmailFrequency/Immediately.php
Processes an activity item.

File

modules/custom/activity_send/modules/activity_send_email/src/Plugin/ActivityDestination/EmailActivityDestination.php, line 52

Class

EmailActivityDestination
Provides a 'EmailActivityDestination' activity destination.

Namespace

Drupal\activity_send_email\Plugin\ActivityDestination

Code

public static function getSendEmailOutputText(Message $message, $langcode = '') {
  $text = NULL;
  if (isset($message)) {
    $activity_factory = \Drupal::service('activity_creator.activity_factory');
    $value = $activity_factory
      ->getMessageText($message, $langcode);

    // Text for email.
    if (!empty($value[2])) {
      $text = $value[2];
    }
    else {
      $text = $value[0];
    }
  }
  return $text;
}