一 配置邮箱
drupal8 邮件功能最优配置是gmail邮箱。
没有的话就注册一个。
注:
1 设置允许其他设备登陆gmail :
登录谷歌账户, 访问 https://www.google.com/settings/security/lesssecureapps,把"不够安全的应用的访问权限" 启用打勾
===========================================================================
二 下载发邮件功能必备模块:
1 SMTP Authentication Support:https://www.drupal.org/project/smtp
2 Mail System:https://www.drupal.org/project/mailsystem
3 Swift Mailer:https://www.drupal.org/project/swiftmailer
===========================================================================
三 配置SMTP
1.INSTALL OPTIONS
Turn this module on or off:on
2.SMTP SERVER SETTINGS
SMTP server:smtp.gmail.com
SMTP backup server:smtp.gmail.com
SMTP port:465
Use encrypted protocol:use SSL
3.SMTP AUTHENTICATION
Username:你的gmail邮箱登陆用户名
Password:你的gmail邮箱登陆密码
4.E-MAIL OPTIONS
E-mail from address:你的gmail邮箱地址
5.SEND TEST E-MAIL
E-mail address to send a test e-mail to:收件人的邮箱地址
6. Enable debugging:勾选上
7.保存配置
注:上述没提到的即不是必须写。
此时。你会收到一封测试邮件。说明SMTP配置成功
===========================================================================
四 配置Mail System
1.DEFAULT MAIL SYSTEM
Formatter:下拉选择Swift Mailer
Sender:下拉选择Swift Mailer
Theme to render the emails:下拉选择Current
2.MODULE-SPECIFIC CONFIGURATION
Module:下拉选择Rules
Key:可以不填
Formatter plugin:下拉选择Swift Mailer
Sender plugin:下拉选择Swift Mailer
3.add
===========================================================================
五 配置Swift Mailer
1.TRANSPORT TYPES
Which transport type should Drupal use to send e-mails:SMTP
2.SMTP transport options
SMTP server:smtp.gmail.com
Port:465
Encryption:SSL
Credential provider:Swift Mailer
Username:你的gmail邮箱登陆用户名
Password:你的gmail邮箱登陆密码
3.保存配置
4.切换到Messages选项页面
MESSAGE FORMAT:HTML(不确定是否必要。先这么配吧)
Respect provided e-mail format勾选上
CHARACTER SET:UTF-8
5.切换到Test选项页面
输入你的邮箱地址
此时。你会收到一封测试邮件。说明Swift Mailer配置成功
===========================================================================
六 配置workflow
1.Workflows:配置审批流程
Approval workflow
上半部分是配置审批流程
下面得THIS WORKFLOW APPLIES TO:注意一下:
Content types:选择需要走审批流程得内容类型
2.Content Moderation Notifications:配置审核内容
(1)Workflow:Approval workflow
(2)Transitions:选择你设置得审批流程转换状态。这部分应该是可以一下添多个状态。也可以添加多个审核内容。一个审核内容一个状态,对应一个审核者的邮箱地址。
(3)Email the author?:打勾
(4)Adhoc email addresses:邮箱地址
(5)Email Subject:邮件主题
(6)Email Body:邮件内容
(7)保存配置
3.Rules 配置反应规则
(1)点击add eaction rules 按钮添加反应规则
(2)React on event:下拉选择:After updating content moderation state
(3)save
(4)点击add condition按钮,选择Data comparison
(5)Edit Condition:
Data selector:content_moderation_state.moderation_state.value
注:点switch to data selection可以切换到数据选择模式。有提示。
OPERATOR:Value:==
DATA VALUE:Value:此处写你之前设置的审核状态(比如:Draft)
(6)save
===========================================================================
七 添加一个带有审核流程的content。测试一下吧。
注:
调出workflow审批流
admin/structure/types/manage/article/display
Moderation control
调出content article 发布时间
admin/structure/types/manage/article
scheduler