class EmailActivityDestination in Open Social 8
Same name and namespace in other branches
- 8.9 modules/custom/activity_send/modules/activity_send_email/src/Plugin/ActivityDestination/EmailActivityDestination.php \Drupal\activity_send_email\Plugin\ActivityDestination\EmailActivityDestination
- 8.2 modules/custom/activity_send/modules/activity_send_email/src/Plugin/ActivityDestination/EmailActivityDestination.php \Drupal\activity_send_email\Plugin\ActivityDestination\EmailActivityDestination
- 8.3 modules/custom/activity_send/modules/activity_send_email/src/Plugin/ActivityDestination/EmailActivityDestination.php \Drupal\activity_send_email\Plugin\ActivityDestination\EmailActivityDestination
- 8.4 modules/custom/activity_send/modules/activity_send_email/src/Plugin/ActivityDestination/EmailActivityDestination.php \Drupal\activity_send_email\Plugin\ActivityDestination\EmailActivityDestination
- 8.5 modules/custom/activity_send/modules/activity_send_email/src/Plugin/ActivityDestination/EmailActivityDestination.php \Drupal\activity_send_email\Plugin\ActivityDestination\EmailActivityDestination
- 8.6 modules/custom/activity_send/modules/activity_send_email/src/Plugin/ActivityDestination/EmailActivityDestination.php \Drupal\activity_send_email\Plugin\ActivityDestination\EmailActivityDestination
- 8.7 modules/custom/activity_send/modules/activity_send_email/src/Plugin/ActivityDestination/EmailActivityDestination.php \Drupal\activity_send_email\Plugin\ActivityDestination\EmailActivityDestination
- 8.8 modules/custom/activity_send/modules/activity_send_email/src/Plugin/ActivityDestination/EmailActivityDestination.php \Drupal\activity_send_email\Plugin\ActivityDestination\EmailActivityDestination
- 10.3.x modules/custom/activity_send/modules/activity_send_email/src/Plugin/ActivityDestination/EmailActivityDestination.php \Drupal\activity_send_email\Plugin\ActivityDestination\EmailActivityDestination
- 10.0.x modules/custom/activity_send/modules/activity_send_email/src/Plugin/ActivityDestination/EmailActivityDestination.php \Drupal\activity_send_email\Plugin\ActivityDestination\EmailActivityDestination
- 10.1.x modules/custom/activity_send/modules/activity_send_email/src/Plugin/ActivityDestination/EmailActivityDestination.php \Drupal\activity_send_email\Plugin\ActivityDestination\EmailActivityDestination
- 10.2.x modules/custom/activity_send/modules/activity_send_email/src/Plugin/ActivityDestination/EmailActivityDestination.php \Drupal\activity_send_email\Plugin\ActivityDestination\EmailActivityDestination
Provides a 'EmailActivityDestination' activity destination.
Plugin annotation
@ActivityDestination(
id = "email",
label = @Translation("Email"),
isAggregatable = FALSE,
isCommon = FALSE,
)
Hierarchy
- class \Drupal\Component\Plugin\PluginBase implements DerivativeInspectionInterface, PluginInspectionInterface
- class \Drupal\activity_creator\Plugin\ActivityDestinationBase implements ActivityDestinationInterface
- class \Drupal\activity_send\Plugin\SendActivityDestinationBase
- class \Drupal\activity_send_email\Plugin\ActivityDestination\EmailActivityDestination
- class \Drupal\activity_send\Plugin\SendActivityDestinationBase
- class \Drupal\activity_creator\Plugin\ActivityDestinationBase implements ActivityDestinationInterface
Expanded class hierarchy of EmailActivityDestination
4 files declare their use of EmailActivityDestination
- ActivityDigestWorker.php in modules/
custom/ activity_send/ modules/ activity_send_email/ src/ Plugin/ QueueWorker/ ActivityDigestWorker.php - ActivitySendEmailWorker.php in modules/
custom/ activity_send/ modules/ activity_send_email/ src/ Plugin/ QueueWorker/ ActivitySendEmailWorker.php - activity_send_email.module in modules/
custom/ activity_send/ modules/ activity_send_email/ activity_send_email.module - Contains activity_basics.module..
- Immediately.php in modules/
custom/ activity_send/ modules/ activity_send_email/ src/ Plugin/ EmailFrequency/ Immediately.php
File
- modules/
custom/ activity_send/ modules/ activity_send_email/ src/ Plugin/ ActivityDestination/ EmailActivityDestination.php, line 18
Namespace
Drupal\activity_send_email\Plugin\ActivityDestinationView source
class EmailActivityDestination extends SendActivityDestinationBase {
/**
* {@inheritdoc}
*/
public static function getSendEmailMessageTemplates() {
return parent::getSendMessageTemplates('email');
}
/**
* {@inheritdoc}
*/
public static function getSendEmailUserSettings($account) {
return parent::getSendUserSettings('email', $account);
}
/**
* {@inheritdoc}
*/
public static function setSendEmailUserSettings($account, $values) {
parent::setSendUserSettings('email', $account, $values);
}
/**
* Get field value for 'output_text' field from data array.
*
* @param \Drupal\message\Entity\Message $message
* The Message object.
* @param string $langcode
* The language in which we need to get the email text.
*
* @return string|null
* If we have message text we return the text, otherwise null.
*/
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;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ActivityDestinationBase:: |
public | function |
Returns a view mode for the entity. Overrides ActivityDestinationInterface:: |
|
ActivityDestinationBase:: |
public | function |
True or false if the activity destination is set. Overrides ActivityDestinationInterface:: |
|
EmailActivityDestination:: |
public static | function | ||
EmailActivityDestination:: |
public static | function | Get field value for 'output_text' field from data array. | |
EmailActivityDestination:: |
public static | function | ||
EmailActivityDestination:: |
public static | function | ||
PluginBase:: |
protected | property | Configuration information passed into the plugin. | 1 |
PluginBase:: |
protected | property | The plugin implementation definition. | 1 |
PluginBase:: |
protected | property | The plugin_id. | |
PluginBase:: |
constant | A string which is used to separate base plugin IDs from the derivative ID. | ||
PluginBase:: |
public | function |
Gets the base_plugin_id of the plugin instance. Overrides DerivativeInspectionInterface:: |
|
PluginBase:: |
public | function |
Gets the derivative_id of the plugin instance. Overrides DerivativeInspectionInterface:: |
|
PluginBase:: |
public | function |
Gets the definition of the plugin implementation. Overrides PluginInspectionInterface:: |
3 |
PluginBase:: |
public | function |
Gets the plugin_id of the plugin instance. Overrides PluginInspectionInterface:: |
|
PluginBase:: |
public | function | Determines if the plugin is configurable. | |
PluginBase:: |
public | function | Constructs a \Drupal\Component\Plugin\PluginBase object. | 92 |
SendActivityDestinationBase:: |
public static | function | Returns message templates for which given destination is enabled. | |
SendActivityDestinationBase:: |
public static | function | Returns target account. | |
SendActivityDestinationBase:: |
public static | function | Returns notification settings of given user. | |
SendActivityDestinationBase:: |
public static | function | Check if user last activity was more than few minutes ago. | |
SendActivityDestinationBase:: |
public static | function | Set notification settings for given user. |