In this article by Mark Noble, we will introduce our imaginary client, the Good Eatin' Bistro, and discuss their plans to build a newsletter for their web site. We will add some new features which will allow Chef Wanyama, who is the owner of the Good Eatin' Bistro, a popular upscale restaurant, to keep his customers informed of current events at Good Eatin' restaurant. We will provide a new means of communication. The feature which is covered in this article is a quarterly newsletter that customers can subscribe to. The newsletter will contain valuable information from Chef Wanyama including coupons, news, recipes, and more.
Creating newsletters
A newsletter is a great way of keeping customers up-to-date without them needing to visit your web site. Customers appreciate well-designed newsletters because they allow the customer to keep tabs on their favorite places without needing to check every web site on a regular basis.
Creating a newsletter
Good Eatin' Goal: Create a new newsletter on the Good Eatin' site, which will contain relevant news about the restaurant, and will be delivered quarterly to subscribers.
Additional modules needed: Simplenews (http://drupal.org/project/simplenews).
Basic steps
Newsletters are containers for individual issues. For example, you could have a newsletter called Seasonal Dining Guide, which would have four issues per year (Summer, Fall, Winter, and Spring). A customer subscribes to the newsletter and each issue is sent to them as it becomes available.
- Begin by installing and activating the Simplenews module, as shown below:

At this point, we only need to enable the Simplenews module, and the Simplenews action module can be left disabled.
-
Next, select Content management and then Newsletters, from the Administer menu. Drupal will display an administration area divided into the following sections:
a) Sent issues
b) Drafts
c) Newsletters
d) Subscriptions -
Click on the Newsletters tab and Drupal will display a page similar to the following:

As you can see, a default newsletter with the name of our site has been automatically created for us. We can either edit this default newsletter or click on the Add newsletter link to create a new newsletter.
-
Let's click the Add newsletter option to create our seasonal newsletter. Drupal will display a standard form where we can enter the name, description, and relative importance (relative importance weight) of the newsletter.
- Click Save to save the newsletter. It will now appear in the list of available newsletters.
-
If you want to modify the Sender information for the newsletter to use an alternate name or email address to your site's default ones, you can either expand the Sender information section when adding the newsletter, or you click Edit newsletter and modify the Sender information, as shown in the following screenshot:


Allowing users to sign-up for the newsletter
Good Eatin' Goal: Demonstrate how registered and unregistered users can sign-up for a newsletter, and configure the registration process.
Additional modules needed: Simplenews (http://drupal.org/project/simplenews).
Basic steps
- To allow customers to sign-up for the newsletter, we will begin by adding a block to the page.
-
Open the Block Manager by selecting Site building and then Blocks, from the Administer menu. Add the block for the newsletter that you want to allow customers to subscribe to, as shown in the following screenshot:

-
We will now need to give users permission to subscribe to newsletters by selecting User management and then Permissions, from the Administer menu. We will give all users permissions to subscribe to newsletters and to view newsletter links, as shown below:

-
If the customer does not have permission to subscribe to newsletters then the block will appear as shown in the following screenshot:

However, if the customer has permissions to subscribe to newsletters, and is logged in to the site, the block will appear as shown in the following screenshot:

If the customer has permission to subscribe, but is not logged in, the block will appear as follows:

- To subscribe to the newsletter, the customer will simply click on the Subscribe button. Once they he subscribed, the Subscribe button will change to Unsubscribe so that the user can easily opt out of the newsletter. If the user does not have an active account with the site, they will need to confirm that they want to subscribe to the site.
Sign up for a Packt account to see the rest of this article
Now that you've read a few articles, you might want to consider signing up for a Packt account. It takes a matter of seconds, will give you access to all the articles on PacktPub.com, and once you've signed up you'll be returned here to carry on reading your article.
Furthermore, you'll gain access to nine free ebooks, and be offered a free trial of PacktLib, Packt's online library. Simply enter your details here, or log in to your existing account.




Post new comment