简体   繁体   English

将邮件发送到Drupal中另一个节点的地址

[英]Send mail to address in another node in Drupal

I have a content type meeting that has a CCK node referer field that refers to one or more people nodes. 我有一个内容类型会议,该会议具有一个CCK节点引用字段,该字段引用一个或多个人员节点。 Those people nodes contain a CCK Email field. 这些人员节点包含CCK电子邮件字段。

Now I'd like to send a mail to all people listed in the meeting node when the node is created. 现在,我想在会议节点创建后向会议节点中列出的所有人发送邮件。 I don't know how to do that as the mail adresses are in different nodes, so I can't just send a tokenized mail, as those adresses are not available as tokens (as far as I can see). 我不知道该怎么办,因为邮件地址位于不同的节点中,所以我不能只发送令牌化的邮件,因为这些地址不能用作令牌(据我所知)。

Any idea on how to do that, preferably without writing a custom module. 关于如何执行此操作的任何想法,最好不要编写自定义模块。

Edit: 编辑:

There seems to be no quick and easy way do to this, so I'll probably have to write some custom code to do that. 似乎没有快速简便的方法可以做到这一点,所以我可能不得不编写一些自定义代码来做到这一点。 I'm already using the Rules module, what would be the preferred way to programatically create a mail action? 我已经在使用“规则”模块,以编程方式创建邮件操作的首选方式是什么? Do I have to create the mail stuff from scratch or can I modify some existing code? 我是否必须从头开始创建邮件内容,还是可以修改一些现有代码?

It looks like you may be able to use a combination of the Rules , Views , and Rules and Views Integration modules to accomplish your goal. 看起来您可以结合使用RulesViewsRules and Views Integration模块来实现您的目标。

  1. Create a view that returns the email address of People associated with a Meeting . 创建一个视图,该视图返回与Meeting相关联的People的电子邮件地址。
  2. Configure the view to "render" its results into a rule that sends emails to the resulting addresses. 配置视图以将其结果“呈现”为规则,该规则将电子邮件发送到结果地址。
  3. Create a rule that executes the view created in step 1 when a Meeting is created. 创建一个规则,该规则将在创建Meeting时执行在步骤1中创建的视图。

Please note that I haven't tried Rules and Views Integration myself, so it may not work as I expect. 请注意,我自己尚未尝试过“规则和视图集成” ,因此它可能无法按我预期的那样工作。 Additionally, I am uncertain if there is an email action for Rules that will take the output of your view as a parameter. 另外,我不确定是否有针对“规则”的电子邮件操作,该操作会将您的视图输出作为参数。

I'm not sure I understand. 我不确定我是否理解。 From reading your question, I would answer "Rules" can do that for you. 通过阅读您的问题,我会回答“规则”可以为您做到。 But then in your edit you say that you use the rules module and you want to create a mail action? 但是,然后在您的编辑中,您说您使用了规则模块,并且想要创建一个邮件操作?

I may be just tired, but please elaborate, and we'll see if we can work it out :) 我可能只是累了,但请详细说明,我们将看看能否解决:)

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

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