2

I have created a custom content type (CCK) called apply (machine name) and installed the Rules module. How would I go about sending the user an email (they could be anonymous or authenticated) after they have created content. I understand that I have to create a rule of some sort, could someone please walk me through it?

I want to capture the content of field_email_address somehow, as that is the field in which the user will be entering their email address.

enter image description here

This is my rule so far, not sure what to put in the Conditions and Elements section.

enter image description here

1 Answer 1

3
  1. Rules works with the token module. If you haven't installed it, do so now.
  2. In your "apply" content type ("application" would be a better name), ensure that your email field is required, and set the default to use token [current-user:mail] so that it fills with the current user's details if they're logged in.
  3. "Conditions" is the "if" part of your rule. You use it to narrow down when the rule fires and by whom. Given that you're not needing auth, you can leave this empty. You could test for various node / field properties here e.g. node is published / field has value etc. Because you specified a content type in your "Event", the fields from that content type will become available to the subsequent "Conditions" and "Actions".
  4. "Actions" are what happens when you trigger your rule. This is where you specify the email action. Click "Add an action", and from the supplied dropdown, choose "System > Send mail" or "Send HTML email".
  5. In the "to" field, you can now add a token referencing the user email - probably something like [node:field_email_address]. Click the "Replacement patterns" accordion to see available tokens for each mail param.
  6. It you're wanting to templatize & theme your HTML emails, that's possible through other modules (mimemail + mailsystem) but requires a separate discussion.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.