官术网_书友最值得收藏!

Custom mail plugins

In the previous section, we saw how we can use the Drupal 8 mail API to send emails programmatically in Drupal 8. In doing so, we used the default PHP mailer, which although is good enough for our example, might not be so for our application. For example, we might want to use an external service via an API.

In this section, we will see how this works. To this end, we will write our own mail plugin that does just that, and then simply tell Drupal to use that system instead of the default one. Yet another plugin-based, non-invasive, extension point.

Before we start, I would like to mention that we won't go into any kind of detail related to the potential external API. Instead, we will stop at the Drupal 8-specific parts, so the code you will find in the repository won't do much—it will be used as an example only. It's up to you to use this technique if you need to.

主站蜘蛛池模板: 宁津县| 华坪县| 新田县| 孝昌县| 科尔| 石城县| 仁寿县| 阿拉善左旗| 河西区| 诏安县| 拜泉县| 明光市| 从江县| 姚安县| 师宗县| 沙雅县| 冀州市| 杭锦旗| 清徐县| 广灵县| 华池县| 和田县| 商南县| 白水县| 南宁市| 台东市| 剑川县| 武鸣县| 来安县| 曲麻莱县| 江达县| 安阳县| 佛学| 礼泉县| 霞浦县| 铁岭市| 芦山县| 南京市| 江油市| 平乡县| 昔阳县|