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

Custom mail plugins

In the preceding 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 teach you how to do this. To this end, we will need to 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, noninvasive, 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.

主站蜘蛛池模板: 安新县| 成武县| 呼玛县| 溧阳市| 景泰县| 石门县| 同心县| 清徐县| 淮阳县| 娱乐| 宁陵县| 水城县| 石林| 肇州县| 永川市| 西青区| 宁海县| 万年县| 永兴县| 易门县| 永德县| 滦平县| 南郑县| 东兰县| 巢湖市| 鄂温| 江油市| 靖安县| 大悟县| 绥棱县| 香格里拉县| 兴国县| 北安市| 石泉县| 濉溪县| 黔南| 册亨县| 新民市| 望谟县| 汪清县| 京山县|