Drupal:从联系表单编辑电子邮件模板
当我在 Drupal 6.x 中的站点范围联系表单中提交消息时,我在每条消息的顶部都会收到以下消息:
[姓名] 使用 [www.mysite.com/contact] 上的联系表单发送了一条消息,
我会想删除此消息。环顾四周,我发现它来自 contact.module 这里:
$message['body'][] = t("!name sent a message using the contact form at !form.", array('!name' => $params['name'], '!form' => url($_GET['q'], array('absolute' => TRUE, 'language' => $language))), $language->language);
我做了一些研究,似乎我需要创建一个带有 hook_mail_alter() 函数的自定义模块来编辑 contact.module。当谈到这一点时,我有点迷失了。有人可以指导我完成完成任务的步骤吗?
非常感谢。
When submitting a message in my site-wide contact form in Drupal 6.x I get the following message along the top of every message:
[Name] sent a message using the contact form at [www.mysite.com/contact]
I would like to remove this message. Looking around, I've found it comes from the contact.module here:
$message['body'][] = t("!name sent a message using the contact form at !form.", array('!name' => $params['name'], '!form' => url($_GET['q'], array('absolute' => TRUE, 'language' => $language))), $language->language);
I've done a bit of research and it seems that I need to create a custom module with a hook_mail_alter() function to edit the contact.module. When it comes to this I get a bit lost. Could anyone kindly take me through the steps to accomplish the task?
Many thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我最近做了类似的事情。这是一个模板,您可以使用它来获取您需要的内容。大部分来自联系人模块。下面的代码来自 Drupal 7,但在 Drupal 6 中应该可以正常工作。
I did something like that recently. Here is a template you can use to get what you need. Most is from the contact module. The code below is from Drupal 7 but should work as is in Drupal 6.