Drupal 8  8.0.2
EmailAction Class Reference
Inheritance diagram for EmailAction:

Public Member Functions

 __construct (array $configuration, $plugin_id, $plugin_definition, Token $token, EntityManagerInterface $entity_manager, LoggerInterface $logger, MailManagerInterface $mail_manager, LanguageManagerInterface $language_manager, EmailValidator $email_validator)
 
 execute ($entity=NULL)
 
 defaultConfiguration ()
 
 buildConfigurationForm (array $form, FormStateInterface $form_state)
 
 validateConfigurationForm (array &$form, FormStateInterface $form_state)
 
 submitConfigurationForm (array &$form, FormStateInterface $form_state)
 
 access ($object, AccountInterface $account=NULL, $return_as_object=FALSE)
 
- Public Member Functions inherited from ConfigurableActionBase
 __construct (array $configuration, $plugin_id, $plugin_definition)
 
 defaultConfiguration ()
 
 getConfiguration ()
 
 setConfiguration (array $configuration)
 
 validateConfigurationForm (array &$form, FormStateInterface $form_state)
 
 calculateDependencies ()
 
- Public Member Functions inherited from ActionBase
 executeMultiple (array $entities)
 
- Public Member Functions inherited from ExecutableInterface
 execute ()
 
- Public Member Functions inherited from PluginInspectionInterface
 getPluginId ()
 
 getPluginDefinition ()
 

Static Public Member Functions

static create (ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition)
 

Protected Attributes

 $token
 
 $storage
 
 $logger
 
 $mailManager
 
 $languageManager
 
 $emailValidator
 

Detailed Description

Sends an email message.

( id = "action_send_email_action", label = ("Send email"), type = "system" )

Constructor & Destructor Documentation

__construct ( array  $configuration,
  $plugin_id,
  $plugin_definition,
Token  $token,
EntityManagerInterface  $entity_manager,
LoggerInterface  $logger,
MailManagerInterface  $mail_manager,
LanguageManagerInterface  $language_manager,
EmailValidator  $email_validator 
)

Constructs a EmailAction object.

Parameters
array$configurationA configuration array containing information about the plugin instance.
string$plugin_idThe plugin ID for the plugin instance.
mixed$plugin_definitionThe plugin implementation definition.
\Drupal\Core\Utility\Token$tokenThe token service.
\Drupal\Core\Entity\EntityManagerInterface$entity_managerThe entity manager.
\Psr\Log\LoggerInterface$loggerA logger instance.
\Drupal\Core\Mail\MailManagerInterfaceThe mail manager.
\Drupal\Core\Language\LanguageManagerInterfaceThe language manager.
\Egulias\EmailValidator\EmailValidator$email_validatorThe email validator.

References EntityTypeManagerInterface\getStorage(), Drupal\languageManager(), Drupal\logger(), and Drupal\token().

Here is the call graph for this function:

Member Function Documentation

access (   $object,
AccountInterface  $account = NULL,
  $return_as_object = FALSE 
)

{Checks object access.

Parameters
mixed$objectThe object to execute the action on.
\Drupal\Core\Session\AccountInterface$account(optional) The user for which to check access, or NULL to check access for the current user. Defaults to NULL.
bool$return_as_object(optional) Defaults to FALSE.
Returns
bool| The access result. Returns a boolean if $return_as_object is FALSE (this is the default) and otherwise an AccessResultInterface object. When a boolean is returned, the result of AccessInterface::isAllowed() is returned, i.e. TRUE means access is explicitly allowed, FALSE means access is either explicitly forbidden or "no opinion".
}

Implements ActionInterface.

References AccessResult\allowed().

Here is the call graph for this function:

buildConfigurationForm ( array  $form,
FormStateInterface  $form_state 
)

{Form constructor.Plugin forms are embedded in other forms. In order to know where the plugin form is located in the parent form, #parents and #array_parents must be known, but these are not available during the initial build phase. In order to have these properties available when building the plugin form's elements, let this method return a form element that has a #process callback and build the rest of the form in the callback. By the time the callback is executed, the element's #parents and #array_parents properties will have been set by the form API. For more documentation on #parents and #array_parents, see .

Parameters
array$formAn associative array containing the initial structure of the plugin form.
\Drupal\Core\Form\FormStateInterface$form_stateThe current state of the complete form.
Returns
array The form structure.
}

Implements PluginFormInterface.

References t().

Here is the call graph for this function:

static create ( ContainerInterface  $container,
array  $configuration,
  $plugin_id,
  $plugin_definition 
)
static

{Creates an instance of the plugin.

Parameters
\Symfony\Component\DependencyInjection\ContainerInterface$containerThe container to pull out services used in the plugin.
array$configurationA configuration array containing information about the plugin instance.
string$plugin_idThe plugin ID for the plugin instance.
mixed$plugin_definitionThe plugin implementation definition.
Returns
static Returns an instance of this plugin.
}

Implements ContainerFactoryPluginInterface.

defaultConfiguration ( )

{Gets default configuration for this plugin.

Returns
array An associative array with the default configuration.
}

Implements ConfigurablePluginInterface.

execute (   $entity = NULL)

{}

References Drupal\languageManager(), Drupal\logger(), PlainTextOutput\renderFromHtml(), and Drupal\token().

Here is the call graph for this function:

submitConfigurationForm ( array &  $form,
FormStateInterface  $form_state 
)

{Form submission handler.

Parameters
array$formAn associative array containing the structure of the plugin form as built by static::buildConfigurationForm().
\Drupal\Core\Form\FormStateInterface$form_stateThe current state of the complete form.
}

Implements PluginFormInterface.

References FormStateInterface\getValue().

Here is the call graph for this function:

validateConfigurationForm ( array &  $form,
FormStateInterface  $form_state 
)

{Form validation handler.

Parameters
array$formAn associative array containing the structure of the plugin form as built by static::buildConfigurationForm().
\Drupal\Core\Form\FormStateInterface$form_stateThe current state of the complete form.
}

Implements PluginFormInterface.

References FormStateInterface\getValue(), FormStateInterface\setErrorByName(), and t().

Here is the call graph for this function:


The documentation for this class was generated from the following file: