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

Chapter 3: Logging and Mailing

In the previous chapter, we learned about some of the more common things most Drupal module developers will have to know, starting with the basics, that is, creating a Drupal module.

In this chapter, we will take things further and cover some other important tasks a developer will have to perform:

  • We will take a look at how logging works in Drupal 9. In doing so, we will cover some examples by expanding on our Hello World module.
  • We will look at the Mail API in Drupal, namely, how we can send emails with the default setup (PHP mail). However, more than that, I will show you how to create your own email system to integrate with your (perhaps external) mail service; remember plugins? This will be yet another good example of using a plugin to extend existing capabilities.
  • At the end of the chapter, we will also look at the Drupal token system. We'll do so in the context of us replacing certain tokens with contextual data so that the emails we send out are a bit more dynamic.

By the end of this chapter, you should be able to add logging to your Drupal module and feel comfortable sending emails programmatically. Additionally, you'll understand how tokens work, and as a bonus, see how you can define your own tokens.

主站蜘蛛池模板: 海丰县| 错那县| 景泰县| 峨眉山市| 阳信县| 宣汉县| 连平县| 文成县| 石家庄市| 曲周县| 民勤县| 安徽省| 通辽市| 冕宁县| 肃宁县| 留坝县| 许昌县| 呼图壁县| 沙坪坝区| 宝鸡市| 遂川县| 惠州市| 娄烦县| 湖北省| 河西区| 安丘市| 崇左市| 高阳县| 东明县| 文昌市| 镇远县| 伊通| 四子王旗| 沭阳县| 慈利县| 永城市| 高要市| 奎屯市| 临汾市| 交口县| 科尔|