daily pastebin goal
40%
SHARE
TWEET

Untitled

a guest Oct 12th, 2018 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3. namespace Drupal\institut_pascal\Plugin\Action;
  4.  
  5. use Drupal\Core\Action\ActionBase;
  6. use Drupal\Core\Session\AccountInterface;
  7.  
  8. /**
  9.  *
  10.  * @Action(
  11.  *   id = "institut_pascal_email_send_webform_submission",
  12.  *   label = @Translation("Send email"),
  13.  *   type = "webform_submission"
  14.  * )
  15.  */
  16. class SendEmailWebformSubmission extends ActionBase {
  17.  
  18.   /**
  19.    * {@inheritdoc}
  20.    */
  21.   public function execute($entity = NULL) {
  22.     /** @var \Drupal\webform\WebformSubmissionInterface $entity */
  23.     ksm($entity);
  24.     $mail_manager = \Drupal::service('plugin.manager.mail');
  25.     ksm($mail_manager);
  26.   }
  27.  
  28.   /**
  29.    * {@inheritdoc}
  30.    */
  31.   public function access($object, AccountInterface $account = NULL, $return_as_object = FALSE) {
  32.     /** @var \Drupal\webform\WebformSubmissionInterface $object */
  33. //    $result = $object->sticky->access('edit', $account, TRUE)
  34. //      ->andIf($object->access('update', $account, TRUE));
  35.  
  36.     return TRUE;
  37.   }
  38.  
  39. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top