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

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.

主站蜘蛛池模板: 天气| 蒲城县| 扎囊县| 庄浪县| 汨罗市| 威海市| 红桥区| 海南省| 东台市| 丹寨县| 信丰县| 天镇县| 徐闻县| 绥中县| 三明市| 得荣县| 岳池县| 巩留县| 葫芦岛市| 洛阳市| 墨竹工卡县| 营山县| 抚松县| 叙永县| 盐城市| 龙泉市| 平利县| 讷河市| 新民市| 景德镇市| 夏邑县| 吉安市| 星座| 甘谷县| 广州市| 景德镇市| 漳州市| 张家口市| 当涂县| 宁蒗| 宁陕县|