Custom methods
Last updated on
3 April 2018
To provide a custom method to send messages, a module must create a class within src/Plugin/SenderMethod folder that implements the \Drupal\sender\Plugin\SenderMethod\SenderMethodInterface. This class must have the @SenderMethod annotation in the comments above it.
The \Drupal\sender\Plugin\SenderMethod\SenderMethodBase class is available to provide default behavior for custom methods and should be extended by them. Doing so, the custom method just have to implement the \Drupal\sender\Plugin\SenderMethod\SenderMethodInterface::send() method.
Please check \Drupal\sender\Plugin\SenderMethod\EmailMethod for a real example.
Help improve this page
Page status: No known problems
You can:
You can:
- Log in, click Edit, and edit this page
- Log in, click Discuss, update the Page status value, and suggest an improvement
- Log in and create a Documentation issue with your suggestion