简体   繁体   English

如何将Drupal设置为默认发件人:电子邮件与接收系统电子邮件的用户的电子邮件不同?

[英]How do I make the Drupal default From: e-mail different than the email of the user who receives system e-mails?

I am creating a site that requires admin approval before creating a user account. 我正在创建一个网站,该网站在创建用户帐户之前需要获得管理员的批准。 In Site Information settings I have set the site's e-mail address to "noreply@mysite.com" 在“ 站点信息”设置中,我已将站点的电子邮件地址设置为“ noreply@mysite.com”

New registrants request an account and they correctly get an e-mail From:noreply@mysite.com No problems there. 新注册者请求一个帐户,他们就可以正确地从以下地址收到电子邮件:noreply@mysite.com。

However, the useful "Approve New User" e-mail also gets sent to "noreply@mysite.com" when I need it to go to "me@mysite.com." 但是,当我需要将有用的“批准新用户”电子邮件发送到“ me@mysite.com”时,该电子邮件也会发送到“ noreply@mysite.com”。 The noreply address is strictly a garbage address I will never check. 严格来说,noreply地址是一个我永远不会检查的垃圾地址。

So, how do I set up a different email for the default "From:" address and the default system alert e-mail recipient address? 因此,如何为默认的“发件人:”地址和默认的系统警报电子邮件收件人地址设置其他电子邮件?

You can use Drupal's hook_mail_alter to intercept the email that gets sent to noreply@mysite.com send it to the desired email address. 您可以使用Drupal的hook_mail_alter截获发送至noreply@mysite.com的电子邮件,然后将其发送至所需的电子邮件地址。 http://api.drupal.org/api/drupal/developer--hooks--core.php/function/hook_mail_alter/6 http://api.drupal.org/api/drupal/developer--hooks--core.php/function/hook_mail_alter/6

It's also possible to do this kind of customization using Triggers and Actions: 也可以使用“触发器”和“动作”进行这种自定义:

http://drupal.org/node/199254 http://drupal.org/node/199254

http://drupal.org/documentation/modules/trigger http://drupal.org/documentation/modules/trigger

There is a module, User Registration Notification, that does what I needed. 有一个模块,用户注册通知,可以完成我需要的工作。 Keep the site e-mail "no-reply" and change the To: value in the module to "me". 保持站点电子邮件为“不答复”,并将模块中的“收件人:”值更改为“我”。

User registration notification 用户注册通知

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM