Lightroom 3 is out »

Excerpt from book "Drupal 6 Social Networking"

This article is extracted from the "Drupal 6 Social Networking" book and re-printed here with permission from Packt Publishing.  LearnWebDesignOnline.com has received complimentary copy of book from publisher.

HTML emails

In order to send HTML (that is, nicely formatted) emails, and emails as attachments to our newsletters, we would need to install the Mime Mail module from http://drupal.org/project/mimemail.

Give it a try
We have covered module installation and configuration extensively; so why not try and install the module yourself and experiment with HTML newsletters.

Legalities

There are legalities involved with sending bulk emails, and mailing lists, especially with regards to SPAM. Most countries have their own laws relating to this.

Throttling

When web sites send out bulk email campaigns, it is important to be careful about their frequency of emails. If all emails in the campaign are sent at once, this could be seen as a sign of SPAM, leading to blacklisting on mail servers, and also penalties from many shared hosts. If emails are sent out slowly, it may take a long time for a campaign to be sent out to all recipients.

The Simplenews module allows us to configure the frequency of the emails sent. These settings can be accessed from Administer | Site configuration | Simplenews | Send mail. Here the cron box is checked, indicating that emails are sent each time the Drupal cron script is called. The Cron throttle defines how many newsletters are sent each time the Drupal cron script is called. By default, it is set to 20, which is very low. So this should be changed perhaps to 100 or 500. You may wish to contact your hosting company for advice on email limits imposed by them.

Third-Party Services

Besides allowing us to run our own email newsletter service from within Drupal, a number of the available modules allow us to make use of third-party mailing list systems.

PHPList

PHPList is a popular mailing list system written in PHP, if we were to use this system (particularly useful if our Drupal social network is part of a group of sites, or part of a larger site which does not use Drupal), we can use the PHPList integration module to:

  • Synchronize users from Drupal to our PHPList system
  • Send targeted mailings based on the values of a user's profile
  • Allow users to manage their PHPList subscriptions from within their account
  • Bulk import into PHPList, if we already have a Drupal installation running with many users
    • Navigate to Administer | Site building | Blocks.
    • Select the Add block tab.
    • Enter a Description, Title and Body for the block, with the benefits of joining in the Block body box.
    • Under Role-specific visibility settings, select Show blog for specific roles for anonymous users.
    • Under Page-specific visibility settings, select the block to be visible on all pages.
    • Save block.
    • A simple bar of information, perhaps relating to a specific feature
    • A simple bar of information, perhaps relating to a specific feature
    • CSS (cascading style sheets) pop ups with information
    • A collapsible message, where the user can click an icon to expand an administrative message, which we can update periodically
    • Newsletters and mailing lists
    • Third-party mailing lists
    • Content blocks
  • This module can be downloaded from http://drupal.org/project/phplist, while PHPList can be downloaded from http://www.phplist.com

    PHPList involves some server configuration; so if PHPList is the solution for you, make sure you read the documentation thoroughly.

    Constant contact

    Constant contact (http://www.constantcontact.com/index.jsp) is an online email marketing service, which manages newsletter subscriptions itself, with a particular focus on privacy and security for subscribers on mailing lists. Drupal 5 had a module to easily link into a constant contact account, http://drupal.org/project/constant_contact. This module, at the time of writing is not available for Drupal 6. But it is worth looking out for updates of this module or an alternative module to take its place if you wish to use constant contact to provide newsletters for your social network.

    Google Groups

    Google Groups are essentially mini social networks that operate in a way similar to groups in our network with the Organic Groups module. Many organizations and projects, such as open source software projects, make use of Google Groups to complement their communication and collaboration areas. If you wish to use Google Groups to complement your social network, then there is a module to allow users to subscribe to your group directly from the site. The module can be downloaded from http://drupal.org/project/google_groups. This module would probably be of little use if you used the organic groups module because the organic groups module provides very similar functionality. Problems with using a service such as Google Groups is that we are limited in terms of controlling the layout of our communications losing any branding associated with our site, and a potential loss of revenue when we may have used advertisements on our site or on our own newsletter.

    Direct contact

    If our social network is an extension of something else, for instance an online supplement to an organization dedicated to the promotion and support of keeping dinosaurs as pets, then we may wish to contact users of our social network using an offline method.

    The Address module allows users to supply a physical address and a telephone number, which means we could post newsletters to our users. This would primarily be of use to organizations which are already producing paper mailers to a wide audience, where the online social network is used to complement the services provided by these organizations; otherwise offline contacting may not be cost effective.

    The address module

    Having installed the address module, and having given users permissions to create an address book, we can collect the addresses, telephone numbers, and fax numbers of our users.

    User's perspective

    From the user's perspective, they can easily store and edit addresses and contact details from within their accounts, via the Address Book tab.

    Administrator's perspective

    Unfortunately, this module was designed to complement other modules (for example, the e-Commerce module) in providing a convenient location for users to store their address for later use (such as ordering products for delivery with the e-Commerce module). There is no back-end interface to allow us, as administrators, to view the contact details of our users. We can, however, gain access to the information from the database directly, and can then maintain our own records from there, or from the $user array via custom PHP code. An alternative would be to create additional user profile fields, which can be read only by administrators.

    Content blocks

    Modules and themes often make use of blocks to display small blocks of content in specific areas of the web site, generally including the web sites header, the sidebars on the left and right-hand side of the screen, the footer, and the main content area, as well as dynamic functionality, such as group information in the Organic groups module. Blocks we have previously been using, such as with the Organic groups module, are dynamic and populated by the modules that created them. Blocks don't have to be dynamic; we can create blocks of our own to display content that doesn't change dynamically.

    We can make use of these blocks to display information and messages to our users. For instance, if we wanted to communicate with guest users, we could create a content block with information on the benefits of joining the site.

    Creating a content block for anonymous users

    Once created, the block is displayed on our site for users who are not logged in:

    Theme customizations for communication

    We could also use the look and feel of our site to communicate with our users. The following are some examples of what we could do:

    These options require knowledge of HTML, CSS, and Drupal themes.

    Summary

    In this article, we looked at how we—as administrators can communicate with our users using a variety of methods including:

    We now have a fully functional social network. Our users can contribute to the site, communicate with each other, and we can communicate with them.


    Drupal 6 Social Networking
    Drupal 6 Social Networking
    • Build a social or community web site, with friends lists, groups, custom user profiles, and much more
    • Step-by-step instructions for putting together a social networking site with Drupal 6
    • Customize your Drupal installation with modules and themes to match the needs of almost any social networking site
    • Allow users to collaborate and interact with each other on your site
    • Requires no prior knowledge of Drupal or PHP; but even experienced Drupal users will find this useful to modify an existing installation into a social web site

    http://www.packtpub.com/build-social-networking-website-with-drupal-6/book


     

    About the Author

     

    Michael Peacock is a web developer from Newcastle, UK and has a degree in Software Engineering from the University of Durham. After meeting his business partner at Durham, he co-founded Peacock Carter, a Newcastle based creative consultancy specializing in web design, web development and corporate identity.

    Michael loves working on web related projects. When he is not working on client projects, he is often tinkering with a web app of his own.

    He has been involved with a number of books, having written three books: Drupal Social Networks, Selling Online with Drupal e-Commerce, Building Web Stes with TYPO3, and acted as technical reviewer for Mobile Web Development and Drupal Education & E-Learning.

    You can follow Michael on Twitter