11

Some people refuse to learn about RSS and wish they could give me (e.g., via some form) e-mail (without registration) and they would be automatically notified about new content.

Could you help me how to achieve this functionality in Drupal 7? I heard about three modules that could help : Rules, Subscriptions and Notify. Only the first works under Drupal 7. Could you configure this functionality with some suitable module?

3
  • When you say "without registration," do you mean that they want to be able to get notified of new content without to have an account on your site?
    – avpaderno
    Commented Jun 14, 2011 at 20:51
  • @kiamlaluno, exactly, it's strange requirement. They don't want to have registered users but they want e-mail notification. I understand that this is little cumbersome (it's site for a company and visitors will be their employers), so I guess I should collect their e-mails and then don't accept new e-mails because of spam possibility.
    – xralf
    Commented Jun 16, 2011 at 8:52
  • It's quite a strange requirement, which eliminate many possible candidates.
    – avpaderno
    Commented Jun 16, 2011 at 11:50

3 Answers 3

19

Rules is best for this, it depends on Entity API.

  • Simple download and enable them from Admin -> Modules
  • Now follow Admin -> Configuration -> Workflow -> Rules
  • Click on Add new rule
  • Define name e.g. "New content email notification" , select 'After Saving new content' from React on event select box and hit the Save
  • On the next page, event is already defined, No condition is required to define here, Head on to Action section and hit Add action
  • Enter recipient email address in the To field box
  • Populate Subject and Message, From fields. (A number of Replacement pattern are available to include in the text)

e.g. New content [node:title] added by [node:author] of type [node:type] on [node:created].

  • Hit the save
  • On the settings fieldset, make sure to check Active check box.
2
  • Thank you for this perfect answer. It works but it only writes this error message after creating a new content Notice: Undefined offset: 0 in node_tokens() (line 140 of /var/www/modules/node/node.tokens.inc). do you think I can repair this?
    – xralf
    Commented Jun 16, 2011 at 9:32
  • And saving new content is very slow now. It seems that it sends e-mail while saving. I looked into configuration if I can send an e-mail 2 minutes after creating new node but seems there is not such option.
    – xralf
    Commented Jun 16, 2011 at 10:19
7

...alternatively, if you need to do this programmatically (not via Rules module), you can hook into hook_node_insert() and grab the $node object, then do with it what you want.

2

Rules will do exactly this:

Example use cases
- Build flexible content publishing workflows changes
- Send customized mails to notify your users about important
- Create custom redirections, system messages, breadcrumbs, ...

Do you need help configuring it ?

2
  • If you have experience with configuration it would be kind of you. I wasn't sure that it will work the way I need, so I rather asked.
    – xralf
    Commented Jun 14, 2011 at 15:42
  • How can i make system send notification from rule for example every 2h and sum up all new content made ? Not sure should i make new question for this..
    – Azz Kawa
    Commented Apr 25, 2016 at 16:17

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