0

I've been looking at a couple of modules and none of them seem to work the way I want to.

I'd like to display a textfield for an anonymous user to enter his email. Everytime a node of a certain type (blog post) is created, an email would be sent to every person who gave their email.

How could I achieve that in Drupal 7 ?

Thanks

3 Answers 3

1

Simplenews looks like it would work perfectly for this.

Simplenews publishes and sends newsletters to lists of subscribers. Both anonymous and authenticated users can opt-in to different mailing lists. HTML email can be sent by adding Mime Mail module.

0

You can write your own custom module. If you are showing form as a block, you can use hook_block_info() or hook_block_configure() hooks

Then use YOURMOUDLE_form api to create form and implement the submit handler for the form i.e YOURMODULE_form_submit() where you write insert queries

Now to send the email you can use hook_node_insert() hook to do your things after the node is inserted in the tables

1
0

Use rules module with the following information. Create a field for that content type called email.

Events After saving new content

Conditions Content is of type "select your content type"

Actions Send mail - and in the to section use your field token like [node:field-email] with an appropriate subject and message.

3
  • I checked rules, but did not understand how to send email to anonymous users. Any hint ?
    – Ebpo
    Commented Nov 7, 2012 at 14:04
  • @Ebpo checkout the videocast for rules as it is very framework and you will end up using it time and again. So take some time and run through all the videos nodeone.se/sv/node/32
    – junedkazi
    Commented Nov 7, 2012 at 14:11
  • Didn't realize it was this big! I will look for sure :) Thanks for the info.
    – Ebpo
    Commented Nov 7, 2012 at 14:26

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.