Drupal 6 Social Networking: Communicating With Users

Packt Pub­lish­ing has kindly pro­vided me Michael Peacock’s Dru­pal 6 Social Net­work­ing to review. They have asked that I pub­lish an except from Chap­ter 6, “Com­mu­ni­cat­ing with Our Users” and I’m glad to do so.

From what I’ve read so far, it’s a well writ­ten book that is use­ful for learn­ing Dru­pal as well as for under­stand­ing why things are done in a cer­tain way. I find the why to be prac­ti­cal… but I’m get­ting ahead of myself. Still read­ing (and play­ing with Dru­pal — it’s awesome).

Enjoy the chap­ter excerpt, and look for my review within a week or so (I hope!).

Intro­duc­tion

Our users can com­mu­ni­cate with one another, which is great, but quite often as an admin­is­tra­tor the need may arise for us to com­mu­ni­cate with a user or users on our site. It may be to remind them about the web site or to inform active users about new changes to the site. In this arti­cle, you will learn:

  • About mail­ing lists, and how to use them with our Dru­pal social network
  • How to use an offline approach for con­tact­ing our users
  • How to use blocks of con­tent to get a mes­sage across to your users

Get­ting Started

We are going to look at a few dif­fer­ent mod­ules, some of which we will use. These need to be installed first, so let’s do that now to save us time.

The Mod­ules

We need to down­load the fol­low­ing modules:

  • Addresses mod­ule to enable the Addresses, Addresses — Phone/Fax and Addresses — Users components.
  • Sim­ple­news module

And extract them to our sites/all/modules folder, and enable them via the admin­is­tra­tion interface.

A Look Back

We have already looked at one very impor­tant aspect to com­mu­ni­cate with our users—user e-mail set­tings. Within the User set­tings page (Admin­is­ter | User man­age­ment | User set­tings), we have a group of set­tings under the head­ing User e-mail set­tings. These are var­i­ous email tem­plates that are sent to our users upon cer­tain events, such as reg­is­tra­tion, account acti­va­tion, pass­word reset, account being blocked or account being deleted. The con­tent of these emails can be very impor­tant depend­ing on the nature of the web site. In our Dino Space site, we may use a very infor­mal, wel­com­ing and fun tone for our auto­mated emails. But for a business-oriented social net­work, we would want to use a much more for­mal tone.

Mod­ules

Don’t for­get, many mod­ules also have their own email tem­plates for send­ing emails to users, all of which can nor­mally be changed eas­ily from their respec­tive sec­tions in the admin­is­tra­tion area.

Com­mu­ni­cat­ing on an Indi­vid­ual Basis

As we have installed the con­tact form mod­ule on our site, we can also com­mu­ni­cate with our users on an indi­vid­ual basis using the con­tact forms on their pro­files. This is handy for those times when we do need to con­tact an indi­vid­ual user, maybe because of com­plaints against them by other mem­bers of the com­mu­nity, or per­haps to invite them to become a mod­er­a­tor or con­trib­u­tor to the site.

Alter­na­tively, we can con­tact the user directly via their email addresses listed in their accounts, as this is view­able from the admin­is­tra­tion area.

Inac­tive Users

We may wish to con­tact users who have not been active on the site for a long time, to remind them that the site is still there, and that they would be wel­come to become active in the com­mu­nity once again. Dru­pal records the time a user was last active, which allows us to eas­ily sort the list of users by their activity.

A mod­ule (Inac­tive user) is avail­able for Dru­pal 5, which is intended to con­tact inac­tive users auto­mat­i­cally, but (at the time of writ­ing this) one is not avail­able for Dru­pal 6. You may wish to keep watch on the mod­ules list on the Drupal.org web site to see if any­thing comes up in future http://drupal.org/project/inactive_user

Com­mu­ni­cat­ing with Indi­vid­u­als Publicly

Don’t for­get, we also have access to all of the com­mu­ni­ca­tion meth­ods avail­able for our users to com­mu­ni­cate with one another, such as reply­ing to posts, com­ment­ing on con­tent, or post­ing on their pro­files. So if we need to con­tact a user, and we can con­tact them pub­licly, we can use these features.

Mail­ing Lists

Dru­pal has a num­ber of mod­ules avail­able for send­ing emails to our users. Many of them are still cur­rently under heavy devel­op­ment, or had their devel­op­ment stopped after the release of a pre­vi­ous ver­sion of Dru­pal. One of these mod­ules is Sim­ple­news, which is a native Dru­pal sys­tem for man­ag­ing newsletters.

One lim­i­ta­tion of the Sim­ple­news mod­ule, and most of the mod­ules avail­able, is that it can’t send to all our users; it requires users to sub­scribe to the mail­ing list.

We can man­age the Sim­ple­news mod­ule via Admin­is­ter | Newslet­ter. The fea­tures avail­able to us are quite com­pre­hen­sive. Let’s have a look at how the mod­ule works:

  • Newslet­ters are cre­ated and man­aged from here
  • Users sub­scribe to var­i­ous Newslet­ters
  • Users can be imported into Newslet­ters to become a subscriber
  • A mes­sage is sent to a newslet­ter (this is referred to as an issue) by cre­at­ing Newslet­ters content
  • Issues which have been sent are saved within the module
  • Issues which have not yet been sent are saved within the mod­ule as drafts

By default, we have a newslet­ter, which is generic to our site based on our site name.

drupal6social-article1-image01

From here we can also cre­ate new Newslet­ters should we wish so. The Sub­scrip­tions tab allows us to see and man­age the sub­scrip­tions to our var­i­ous newslet­ters, the Sent issues tab lists issues sent out to the newslet­ter lists, and the Drafts tab lists issues which are still being writ­ten. From within the Set­tings tab, we can set how new issues for newslet­ters are cre­ated, as well as the email address shown as the sender of issues.

Don’t for­get to set the per­mis­sions; you want your users to be able to sub­scribe to newslet­ters.

Users can sub­scribe to newslet­ters from within their account, or we can enable blocks for the rel­e­vant newslet­ters we have on our site.

To send an “issue” to our newslet­ter list, we need to cre­ate the issue as a new con­tent ele­ment via Cre­ate con­tent | Newslet­ter issue.

We enter the sub­ject of our email as the Title, select the newslet­ter to send the mes­sage to from the Newslet­ter drop-down list, and the mes­sage is entered into the Bodybox.

Beneath these options, we have some newslet­ter specific-options within the Newslet­ter send­ing options box. These options allow us to set the pri­or­ity of the email mes­sage (this is often ignored by email clients), if we wish to request a receipt to see if a user has read the mes­sage (this is also often ignored by email clients) and finally, we can select a send­ing method.

There are three send­ing meth­ods, which are:

  • Don’t send now — this won’t send the mes­sage, and will save it as a draft.
  • Send one test newslet­ter to the test address — this will send the email mes­sage to the test email addresses, which can be set in the admin­is­tra­tion area. This allows us to review the newslet­ter, as if we were a sub­scriber, make any final alter­ations and then send it to our list.
  • Send newslet­ter — this sends the email to our newslet­ter list.

How to Send an Email to All our Users?

We can use the mod­ule to send an email to all of our users, by tak­ing advan­tage of the sub­scriber import fea­ture. Within Admin­is­ter | Con­tent man­age­ment | Newslet­ters | Sub­scrip­tions, we have the abil­ity to Import sub­scrip­tions, as shown in the fol­low­ing screenshot:

Import­ing sub­scribers con­sists of enter­ing the E-mail addresses (sep­a­rated by a comma) and select­ing the newslet­ter which we wish the user to sub­scribe to. To get all of our cur­rent mem­bers to sub­scribe to the mail­ing list, we could export all of our users’ email addresses directly from the Dru­pal data­base, using a tool such as php­MyAd­min. If we use the tool cor­rectly, we can even get the data in a comma-separated list ready to be pasted into the form.


Dru­pal 6 Social Networking
Drupal 6 Social Networking
  • Build a social or com­mu­nity web site, with friends lists, groups, cus­tom user pro­files, and much more
  • Step-by-step instruc­tions for putting together a social net­work­ing site with Dru­pal 6
  • Cus­tomize your Dru­pal instal­la­tion with mod­ules and themes to match the needs of almost any social net­work­ing site
  • Allow users to col­lab­o­rate and inter­act with each other on your site
  • Requires no prior knowl­edge of Dru­pal or PHP; but even expe­ri­enced Dru­pal users will find this use­ful to mod­ify an exist­ing instal­la­tion into a social web site

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


HTML Emails

In order to send HTML (that is, nicely for­mat­ted) emails, and emails as attach­ments to our newslet­ters, we would need to install the Mime Mail mod­ule from http://drupal.org/project/mimemail.

Give it a try
We have cov­ered mod­ule instal­la­tion and con­fig­u­ra­tion exten­sively; so why not try and install the mod­ule your­self and exper­i­ment with HTML newsletters.

Legal­i­ties

There are legal­i­ties involved with send­ing bulk emails, and mail­ing lists, espe­cially with regards to SPAM. Most coun­tries have their own laws relat­ing to this.

Throt­tling

When web sites send out bulk email cam­paigns, it is impor­tant to be care­ful about their fre­quency of emails. If all emails in the cam­paign are sent at once, this could be seen as a sign of SPAM, lead­ing to black­list­ing on mail servers, and also penal­ties from many shared hosts. If emails are sent out slowly, it may take a long time for a cam­paign to be sent out to all recipients.

The Sim­ple­news mod­ule allows us to con­fig­ure the fre­quency of the emails sent. These set­tings can be accessed from Admin­is­ter | Site con­fig­u­ra­tion | Sim­ple­news | Send mail. Here the cron box is checked, indi­cat­ing that emails are sent each time the Dru­pal cron script is called. The Cron throt­tle defines how many newslet­ters are sent each time the Dru­pal cron script is called. By default, it is set to 20, which is very low. So this should be changed per­haps to 100 or 500. You may wish to con­tact your host­ing com­pany for advice on email lim­its imposed by them.

Third Party Services

Besides allow­ing us to run our own email newslet­ter ser­vice from within Dru­pal, a num­ber of the avail­able mod­ules allow us to make use of third-party mail­ing list systems.

PHPList

PHPList is a pop­u­lar mail­ing list sys­tem writ­ten in PHP, if we were to use this sys­tem (par­tic­u­larly use­ful if our Dru­pal social net­work is part of a group of sites, or part of a larger site which does not use Dru­pal), we can use the PHPList inte­gra­tion mod­ule to:

  • Syn­chro­nize users from Dru­pal to our PHPList system
  • Send tar­geted mail­ings based on the val­ues of a user’s profile
  • Allow users to man­age their PHPList sub­scrip­tions from within their account
  • Bulk import into PHPLIst, if we already have a Dru­pal instal­la­tion run­ning with many users

The PHPList mod­ule for Dru­pal can be down­loaded from here, while PHPList can be down­loaded here.

PHPList involves some server con­fig­u­ra­tion; so if PHPList is the solu­tion for you, make sure you read the doc­u­men­ta­tion thoroughly.

Con­stant Contact

Con­stant con­tact is an online email mar­ket­ing ser­vice, which man­ages newslet­ter sub­scrip­tions itself, with a par­tic­u­lar focus on pri­vacy and secu­rity for sub­scribers on mail­ing lists. Dru­pal 5 had a mod­ule to eas­ily link into a con­stant con­tact account. This mod­ule, at the time of writ­ing is not avail­able for Dru­pal 6. But it is worth look­ing out for updates of this mod­ule or an alter­na­tive mod­ule to take its place if you wish to use con­stant con­tact to pro­vide newslet­ters for your social network.

Google Groups

Google Groups are essen­tially mini social net­works that oper­ate in a way sim­i­lar to groups in our net­work with the Organic Groups mod­ule. Many orga­ni­za­tions and projects, such as open source soft­ware projects, make use of Google Groups to com­ple­ment their com­mu­ni­ca­tion and col­lab­o­ra­tion areas. If you wish to use Google Groups to com­ple­ment your social net­work, then there is a mod­ule to allow users to sub­scribe to your group directly from the site. The mod­ule can be down­loaded from http://drupal.org/project/google_groups. This mod­ule would prob­a­bly be of lit­tle use if you used the organic groups mod­ule because the organic groups mod­ule pro­vides very sim­i­lar func­tion­al­ity. Prob­lems with using a ser­vice such as Google Groups is that we are lim­ited in terms of con­trol­ling the lay­out of our com­mu­ni­ca­tions los­ing any brand­ing asso­ci­ated with our site, and a poten­tial loss of rev­enue when we may have used adver­tise­ments on our site or on our own newsletter.

Direct Con­tact

If our social net­work is an exten­sion of some­thing else, for instance an online sup­ple­ment to an orga­ni­za­tion ded­i­cated to the pro­mo­tion and sup­port of keep­ing dinosaurs as pets, then we may wish to con­tact users of our social net­work using an offline method.

The Address mod­ule allows users to sup­ply a phys­i­cal address and a tele­phone num­ber, which means we could post newslet­ters to our users. This would pri­mar­ily be of use to orga­ni­za­tions which are already pro­duc­ing paper mail­ers to a wide audi­ence, where the online social net­work is used to com­ple­ment the ser­vices pro­vided by these orga­ni­za­tions; oth­er­wise offline con­tact­ing may not be cost effective.

The Address Module

Hav­ing installed the address mod­ule, and hav­ing given users per­mis­sions to cre­ate an address book, we can col­lect the addresses, tele­phone num­bers, and fax num­bers of our users.

User’s Per­spec­tive

From the user’s per­spec­tive, they can eas­ily store and edit addresses and con­tact details from within their accounts, via the Address Book tab.

Administrator’s Per­spec­tive

Unfor­tu­nately, this mod­ule was designed to com­ple­ment other mod­ules (for exam­ple, the e-Commerce mod­ule) in pro­vid­ing a con­ve­nient loca­tion for users to store their address for later use (such as order­ing prod­ucts for deliv­ery with the e-Commerce mod­ule). There is no back-end inter­face to allow us, as admin­is­tra­tors, to view the con­tact details of our users. We can, how­ever, gain access to the infor­ma­tion from the data­base directly, and can then main­tain our own records from there, or from the $user array via cus­tom PHP code. An alter­na­tive would be to cre­ate addi­tional user pro­file fields, which can be read only by administrators.

Con­tent Blocks

Mod­ules and themes often make use of blocks to dis­play small blocks of con­tent in spe­cific areas of the web site, gen­er­ally includ­ing the web sites header, the side­bars on the left and right-hand side of the screen, the footer, and the main con­tent area, as well as dynamic func­tion­al­ity, such as group infor­ma­tion in the Organic groups mod­ule. Blocks we have pre­vi­ously been using, such as with the Organic groups mod­ule, are dynamic and pop­u­lated by the mod­ules that cre­ated them. Blocks don’t have to be dynamic; we can cre­ate blocks of our own to dis­play con­tent that doesn’t change dynamically.

We can make use of these blocks to dis­play infor­ma­tion and mes­sages to our users. For instance, if we wanted to com­mu­ni­cate with guest users, we could cre­ate a con­tent block with infor­ma­tion on the ben­e­fits of join­ing the site.

Cre­at­ing a Con­tent Block for Anony­mous Users

  • Nav­i­gate to Admin­is­ter | Site build­ing | Blocks.
  • Select the Add Block tab
  • Enter a Descrip­tion, Title and Body for the block, with the ben­e­fits of join­ing in the Block Body box.
  • Under Role-specific vis­i­bil­ity set­tings, select Show Blog for spe­cific roles for anony­mous users.
  • Under Page-specific vis­i­bil­ity set­tings, select the block to be vis­i­ble on all pages.
  • Save block.

Once cre­ated, the block is dis­played on our site for users who are not logged in:

Theme Cus­tomiza­tions for Communication

We could also user the look and feel of our site to com­mu­ni­cate with users. The fol­low­ing are some exam­ples of what we could do:

  • A sim­ple bar of infor­ma­tion, per­haps relat­ing to a spe­cific feature
  • CSS (cas­cad­ing style sheets) pop ups with information
  • A col­lapsable mes­sage, where the user can click an icon to expand an admin­is­tra­tive mes­sage, which we can update periodically

These options require knowl­edge of HTML, CSS, and Dru­pal Themes.

Sum­mary

In this arti­cle we looked at how we, as admin­is­tra­tors, can com­mu­ni­cate with our users using a vari­ety of meth­ods, including:

  • Newslet­ters and mail­ing lists
  • Third party mail­ing lists
  • Con­tent blocks

We now have a fully func­tional social net­work. Our users can con­tribute to the site, com­mu­ni­cate with each other, and we can com­mu­ni­cate with them.


Dru­pal 6 Social Networking
Drupal 6 Social Networking
  • Build a social or com­mu­nity web site, with friends lists, groups, cus­tom user pro­files, and much more
  • Step-by-step instruc­tions for putting together a social net­work­ing site with Dru­pal 6
  • Cus­tomize your Dru­pal instal­la­tion with mod­ules and themes to match the needs of almost any social net­work­ing site
  • Allow users to col­lab­o­rate and inter­act with each other on your site
  • Requires no prior knowl­edge of Dru­pal or PHP; but even expe­ri­enced Dru­pal users will find this use­ful to mod­ify an exist­ing instal­la­tion into a social web site

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


About the Author

Michael Pea­cock is a web devel­oper from New­cas­tle, UK and has a degree in Soft­ware Engi­neer­ing from the Uni­ver­sity of Durham. After meet­ing his busi­ness part­ner at Durham, he co-founded Pea­cock Carter, a New­cas­tle based cre­ative con­sul­tancy spe­cial­iz­ing in web design, web devel­op­ment and cor­po­rate identity.

Michael loves work­ing on web related projects. When he is not work­ing on client projects, he is often tin­ker­ing with a web app of his own.

He has been involved with a num­ber of books, hav­ing writ­ten three books: Dru­pal Social Net­works, Sell­ing Online with Dru­pal e-Commerce, Build­ing Web Stes with TYPO3, and acted as tech­ni­cal reviewer for Mobile Web Devel­op­ment and Dru­pal Edu­ca­tion & E-Learning.

You can fol­low Michael on Twit­ter