You are here

class User in Courier 8

Same name in this branch
  1. 8 src/Plugin/IdentityChannel/CourierEmail/User.php \Drupal\courier\Plugin\IdentityChannel\CourierEmail\User
  2. 8 tests/modules/courier_test_message/src/Plugin/IdentityChannel/TestMessage/User.php \Drupal\courier_test_message\Plugin\IdentityChannel\TestMessage\User
Same name and namespace in other branches
  1. 2.x src/Plugin/IdentityChannel/CourierEmail/User.php \Drupal\courier\Plugin\IdentityChannel\CourierEmail\User

Supports core user entities.

Plugin annotation


@IdentityChannel(
  id = "identity:user:courier_email",
  label = @Translation("Drupal user to courier_mail"),
  channel = "courier_email",
  identity = "user",
  weight = 10
)

Hierarchy

Expanded class hierarchy of User

File

src/Plugin/IdentityChannel/CourierEmail/User.php, line 26
Contains \Drupal\courier\Plugin\IdentityChannel\CourierEmail\User.

Namespace

Drupal\courier\Plugin\IdentityChannel\CourierEmail
View source
class User implements IdentityChannelPluginInterface {

  /**
   * {@inheritdoc}
   */
  public function applyIdentity(ChannelInterface &$message, EntityInterface $identity) {

    /** @var \Drupal\user\UserInterface $identity */

    /** @var \Drupal\courier\EmailInterface $message */
    $message
      ->setRecipientName($identity
      ->label());
    $message
      ->setEmailAddress($identity
      ->getEmail());
  }

}

Members

Namesort descending Modifiers Type Description Overrides
User::applyIdentity public function Inserts the identity into the message. Overrides IdentityChannelPluginInterface::applyIdentity