{% extends "base/class.php.twig" %}

{% block file_path %}
\Drupal\{{module}}\Plugin\Mail\{{class_name}}.
{% endblock %}

{% block namespace_class %}
namespace Drupal\{{module}}\Plugin\Mail;
{% endblock %}

{% block use_class %}
use Drupal\Core\Mail\Plugin\Mail\PhpMail;
{% if services is not empty %}
use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
{% endif %}
{% endblock %}

{% block use_class_services %}
{% endblock %}

{% block class_declaration %}
/**
 * Provides a '{{class_name}}' mail plugin.
 *
 * @Mail(
 *  id = "{{plugin_id}}",
 *  label = @Translation("{{label}}")
 * )
 */
class {{class_name}} extends PhpMail {% if services is not empty %}implements ContainerFactoryPluginInterface {% endif %}
{% endblock %}

{% block class_create %}
{% if services is not empty %}
  /**
   * {@inheritdoc}
   */
  public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
    $instance = new static($configuration, $plugin_id, $plugin_definition);
{{ serviceClassInjectionNoOverride(services) }}
    return $instance;
  }
{% endif %}
{% endblock %}

{% block class_methods %}

  /**
   * {@inheritdoc}
   */
  public function format(array $message) {
  }

  /**
   * {@inheritdoc}
   */
  public function mail(array $message) {
  }
{% endblock %}
