<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div>Steve and all,</div><div><br></div><div>Rules is powerful; The possibilities endless.<br><br>I actually considered precisely what you did. But I rejected it, at least for now, because it's yet one more demand on the person filling out the form. Even as an optional field it's another decision they have to make.&nbsp;</div><div><br></div><div>I thought we'd get more people actually submitting the resource and choosing to announce it via the listserve without the custom text in the email. Just my hunch though. Certainly don't to do legitimate testing on that issue.</div><div><br>Shai</div><div><br>On Feb 24, 2013, at 3:08 PM, Steve Kessler &lt;<a href="mailto:skessler@denverdataman.com">skessler@denverdataman.com</a>&gt; wrote:<br><br></div><blockquote type="cite"><div><p dir="ltr">Shai,</p>
<p dir="ltr">I just took a very similar case a step further by letting the user add "email text" and then I use that token as well.&nbsp; This would let you have people use some of there own text. </p>
<p dir="ltr">-Steve</p>
<div class="gmail_quote">On Feb 24, 2013 12:32 PM, "Shai Gluskin" &lt;<a href="mailto:shai@content2zero.com">shai@content2zero.com</a>&gt; wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr"><div><div><div><div><div><div><div>Nancy, Steve, and All,<br><br>Thanks much, Nancy.<br><br></div>For those looking at Nancy's export, note that it requires another module in addition to rules: workflow. So you couldn't just import that rule at all unless the workflow module was installed.<br>

<br></div>Also note that what it is trying to do is different from what I was asking.<br><br></div>I've got my functionality working! Hurray, with your help!<br><br>&nbsp;First let me explain that I changed my requirements after pondering the power of the Rules module. Instead of prepopulating the contact form, Rules sends the email on its own.<br>

<br></div>I added a field to the "resources" content type whose machine name is field-announce-resource. It's a numeric integer list type. The two choices I've set are: <br>0|No<br>1|Yes<br><br></div>In the rule, I added a condition to check to see if the value of that field is "1". If it is, then the email goes out, if not, then it doesn't.<br>

<br></div><div>Here is the help text I added on the Announce field:<br><br><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote">If you choose "Yes," an email will be sent from you and signed by you to <a href="mailto:listserve@example.com" target="_blank">listserve@example.com</a>. It will include the title and URL of this resource. The email will successfully post to the listserve only if your account email here on <a href="http://example.com" target="_blank">example.com</a> and your subscription email to the listserve are the same.<br>

</blockquote></div><div><br></div>I had originally wanted the person posting the resource to be able to customize the outgoing email, but I decided an email would be better.<br><br></div>Here is the text for the automated email, which is put in via the rules UI:<br>

<br><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote">Folks,<br><div><br>I have just posted a new resource at <a href="http://example.com" target="_blank">example.com</a>: [node:title]<br>

<br>Check it out at: [node:url]<br><br>[node:author]<br></div></blockquote><div><br></div><div>One thing I was very please about was setting up the from address of the email. I used:<br><br><span style="font-family:courier new,monospace">[node:author] &lt;[node:author:mail]&gt;</span><br>

<br></div><div>&nbsp;which produces a well formed from Email address with the full name and email address. (Note that on the site in question the username is always the persons full name.) Using the Rules' "data selection" tool you can only select one value, so you would have to use: <span style="font-family:courier new,monospace">[node:author:mail]. <font face="arial,helvetica,sans-serif">Using the "direct input" method I could get the "from" field to be exactly as I wanted it.</font><br>

</span></div><div><br></div><div>Rules is amazing. There is some learning curve, but it is worth it.<br><br></div><div>What follows below is my rule exported. In order to properly import on your site (and of course you can change it using the rules UI after you've imported it), you need to have a content type called "resource" it needs to have a field whose machine name is "field-announce-resource" which is a numeric field where "1" means "send the email".<br>

<br></div><div>Thanks everyone for all the help.<br><br></div><div>Shai<br></div><div><div><div><br><br><span style="font-family:courier new,monospace">{ "rules_post_to_listserve_about_new_resource" : {<br>&nbsp;&nbsp;&nbsp; "LABEL" : "Post to listserve about new resource",<br>

&nbsp;&nbsp;&nbsp; "PLUGIN" : "reaction rule",<br>&nbsp;&nbsp;&nbsp; "TAGS" : [ "email", "resources" ],<br>&nbsp;&nbsp;&nbsp; "REQUIRES" : [ "rules" ],<br>&nbsp;&nbsp;&nbsp; "ON" : [ "node_insert" ],<br>

&nbsp;&nbsp;&nbsp; "IF" : [<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; { "node_is_of_type" : {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "node" : [ "node" ],<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "type" : { "value" : { "resource" : "resource" } }<br>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; },<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; { "data_is" : { "data" : [ "node:field-announce-resource" ], "value" : "1" } }<br>&nbsp;&nbsp;&nbsp; ],<br>&nbsp;&nbsp;&nbsp; "DO" : [<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; { "mail" : {<br>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "to" : "<a href="mailto:listserve@example.com" target="_blank">listserve@example.com</a>",<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "subject" : "New Resource at <a href="http://Example.com">Example.com</a>",<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "message" : "Folks,\u000D\u000A\u000D\u000AI have just posted a new resource at <a href="http://example.com" target="_blank">example.com</a> called: [node:title]\u000D\u000A\u000D\u000ACheck it out at: [node:url]\u000D\u000A\u000D\u000A[node:author]\u000D\u000A\u000D\u000A",<br>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "from" : "[node:author] \u003C[node:author:mail]\u003E",<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "language" : [ "" ]<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; ]<br>&nbsp; }</span><br><div class="gmail_extra"><br></div>

</div></div></div></div>
<br>--<br>
[ Drupal support list | <a href="http://lists.drupal.org/" target="_blank">http://lists.drupal.org/</a> ]<br></blockquote></div>
</div></blockquote><blockquote type="cite"><div><span>-- </span><br><span>[ Drupal support list | <a href="http://lists.drupal.org/">http://lists.drupal.org/</a> ]</span></div></blockquote></body></html>