11

I have a blog in English and Japanese in Drupal 7. I created this blog using a custom content type and Views, not the built-in blog module.

I have an RSS feed (made in Views) for each language. I would like to allow users to subscribe to receive all English-language updates to content type "blog" or all Japanese-language updates to content type "blog." (I anticipate most users will only want one language or the other. If a user really wants both languages, I don't mind making them subscribe twice.)

I looked into using Feedburner on the RSS feeds, but the Feedburner module has not been updated for D7 and I would rather not rely on an external service. (When I tried setting up Feedburner without the module, it told me my RSS feed didn't exist even though the support link allowed me to validate it.)

I also looked at the Simplenews module, but that module apparently requires creating each newsletter post separately. What I want to do is automatically e-mail subscribed users when I post an update to the blog.

I'm sure there are a lot of ways to do this, but there are so many "mail helper"-type modules that I'm at a loss as to where to get started.

To summarize my requirements, I want to:

  • Automatically e-mail subscribers when a new blog post in the appropriate language is added.
  • Both authenticated and anonymous users should be able to subscribe.
  • Subscriptions must require confirmation (legal requirement).
  • Compatibility with the MIME Mail module would be a nice bonus.
1
+50

Another alternative option is using Google Feedburner to send the email on your behalf.

See the documentation online for more information.

Once Google feedburner has 'burned' your feeds, you can get an embed code for the sign-up form so users can receive email alerts. The reason why this suits your needs so well, is that it all revolves around having a quality RSS feed source, and Views is capable of producing this. The only real question is whether you want to have full content or a teaser only in the RSS (and therefore email).

Another advantage this has over the above newsletter/trigger options is that it only sends a daily digest, so at max 1 email is sent per day for each RSS feed burned. This will prevent you from spamming your loyal subscribers when you have active days.

Google feedburner features include (straight from the above documentation):

Subscription management

  • View and sort the list
  • Activate, deactivate, and delete individual email addresses
  • Export your list in Excel or CSV format
  • Receive an optional email when people unsubscribe

Communication preferences

  • Customize the subject line and body text of the email that is sent to subscribers after they opt in to receive your feed by email. This can come in handy if you want to localize the email.
  • IMPORTANT NOTE: Emails are text only and the original ${confirmlink} reference must be included in your confirmation email in order to activate the subscription.

Email Branding

  • Customize the subject line and title of the email that is sent to your subscribers
  • Add a custom logo that appears at the top of HTML email messages
  • Change body and headline text fonts, sizes, and color as well as the color of the links

Delivery Options

  • Choose your time zone
  • Select a two-hour delivery window within which your daily digest will be sent

Example tutorial on how to set this up can be found here.

  • Thanks for suggesting Feedburner, but as noted in the original question, it refused to burn my feeds despite the fact that it was able to validate them. The exact error it gives me is "Received HTTP error code 400 while fetching source feed."; however, when I click the "Validate this feed" link on the error page, it tells me that the feed is valid. Unfortunately, Feedburner also has no support options. – Patrick Kenny Sep 4 '12 at 12:05
  • I had the same error, our issue was that Google feedburner does not support SSL. The easy solution is allow HTTP access to the feed. – wiifm Sep 5 '12 at 20:34
  • 1
    If allowing HTTP access to the feeds is not an option, on a recent project we actually proxyied the RSS feed through Google reader, and then into Google feedburner (messy, but it works). Here is an example feed from this process feeds.feedburner.com/TranspowerNewsFeed - as the entire site transpower.co.nz is secured under HTTPS – wiifm Sep 5 '12 at 20:37
  • Awarding this answer the bounty because it turns out that this was far easier for me to set up in Feedburner, even having to do the SSL redirect through Google Reader, than using Simplenews. – Patrick Kenny Sep 8 '12 at 12:16
5

This can be acquired easily. I can give you some steps to follow.

There are actually at least 2 ways to achieve that

A. Using Triggers (core module)

  1. First activate the core module Triggers. This will provide you basic triggers (in your case UPDATE trigger) and actions to run when condition is met.

  2. Go to Admin > Configuration > Actions then CREATE AN ADVANCED ACTION, then select: Send e-mail. In the recipient field you need to select a proper token provided by simplenews module to match all the registered users. (make sure you also have Token module installed)

  3. Go to Admin > Structure > Triggers, then Node tab. Choose the third: TRIGGER: AFTER SAVING UPDATED CONTENT.

If you need more control then implement the hook

function YOURMODULE_trigger_info_alter(&$triggers) { //Here dpm($triggers) to see where is your update trigger and do the changes. } ?>

B. Using Rules (contrib module) Basic the same thing. If you get stuck follow these steps on a similar issue on this blog: http://adellefrank.com/blog/how-to-email-notifications-comments-drupal7

  • 1
    'TRIGGER: AFTER SAVING NEW CONTENT' will send a single email on post creation where as 'TRIGGER: AFTER SAVING UPDATED CONTENT' will send a new email if any updates are made to the post. – Citricguy Sep 3 '12 at 7:29
  • 1
    If using Rules, why would I use the "Send e-mail" action instead of the "Send an e-mail newsletter" action provided by the Simplenews module? – Patrick Kenny Sep 3 '12 at 12:26
5

Simplenews module does everything what you need. It can be configured that each your blog post automatically became an newsletter and are sent to subscribers. Just in Simplenews configuration select content type Blog to be a newsletter source.

To make this:

  1. Open configuration form of Blog content type (/admin/structure/types/manage/blog)
  2. In "Publishing options" tab check "Use as simplenews newsletter"
  • Where in the Simplenews configuration is the "Newsletter source" option? I think I've been through all the menus and I didn't find anything resembling that... – Patrick Kenny Sep 3 '12 at 12:21
  • See updated answer above. – Eugene Fidelin Sep 5 '12 at 8:28
1

If you want to do it programmatically, see drupal_mail($module, $key, $to, $language, $params = array(), $from = NULL, $send = TRUE),

When node is updated the hook hook_node_update($node) will be fired. If you want to create own composed mail format use hook_mail($key, &$message, $params). So you have to write 2 hooks first hook_node_update and hook_mail. Inside hook_node_update you have to write drupal_mail function that will call your hook_mail.

0

You can use my sandbox module Total Subscription

This module is in drupal project queue. Here is the link for it:- LINK

I think it will give functionality which you require.

  • 1
    Could you expand a little on how this module will solve the user's problem? – mpdonadio Jan 17 '14 at 13:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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