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

  • Drupal 9 Module Development
  • Daniel Sipos Antonio De Marco
  • 226字
  • 2021-06-11 18:36:03

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.

主站蜘蛛池模板: 仙桃市| 云龙县| 怀来县| 巴青县| 罗城| 旅游| 苍梧县| 老河口市| 怀宁县| 屯留县| 廊坊市| 遵义市| 府谷县| 安西县| 谷城县| 怀来县| 鄢陵县| 惠东县| 交城县| 西城区| 壶关县| 威海市| 昭觉县| 临朐县| 札达县| 北安市| 陇南市| 牡丹江市| 惠东县| 晴隆县| 北京市| 肇源县| 丽江市| 广西| 长海县| 临沂市| 同江市| 临城县| 广灵县| 密云县| 福贡县|