Configuring Email in CiviCRM
The preceding chapter set up your mail server to support CiviCRM's mail functions. This chapter covers configuration of CiviCRM itself. The configuration steps in this chapter are essential if you want to delegate the creation and sending of mailings to someone in your organization using CiviCRM.
Configuring the domain information
Your domain information is basic information about your organization: its name, a short description, your email address and your physical postal address. CiviMail requires that you include the sender's physical address along with unsubscribe/optout links in any email you send, in order to comply with privacy laws in many countries. This information is made available via tokens and must be included in any mail sent with CiviMail.
To configure the domain information, go to: Administer > Configure > Domain Information.
CiviMail uses Groups to manage subscriptions to mailing lists. To create a group, go to: Contacts > New Group. When you create and configure a Group for this purpose, make sure to check Mailing List so that it is available as a Mailing List in CiviMail.
You can also create Smart Groups using the search forms. For example, using the Advanced Search you can create a Smart Group of contacts who have active memberships, or a Smart Group of contacts in a given city. You can then use the Smart Group to send mailings without having to first update the contacts in that group.
To create a Smart Group:
- Go to any of the search forms and run a search query based on the criteria for your group.
- On the search results page, click the radio button that selects all the records.
- Click on " - more actions - ", select New Smart Group and then click Go.
- The next screen provides a review of the criteria chosen for the Smart Group. Give the Smart Group a name and (optionally) a description, and make the Smart Group a Mailing List.
- Click Save Smart Group.
Configure mailing list subscription pages
CiviCRM provides a page that allows users to sign up for email directly from your website. This page is available at www.yourdomain.org/civicrm/mailing/subscribe.
This page contains all the groups that have publicly viewable mailing lists and allows visitors to subscribe directly to these groups. After people fill in this form, they will be sent an email asking them to confirm their subscription and their details will appear in CiviCRM with their group subscription set to Pending. When they click the confirmation link in the email, their group subscription will be set to Added.
Another way to add contacts to a group is to create a profile, make this profile public and set the profile so that when it is completed, the contact is added to a group. The advantage of using a profile is that you can collect extra fields. The disadvantage is that there is no email verification.
When you use a profile to enable emall subscriptions, decide what information you want to ask contacts on the registration form. Avoid asking for information just because you might need it laterr. Focus on what is immediately useful and strive to keep the form as short as possible. It is probably wise to add a Recaptcha to avoid getting a lot of spam contact.
Creating templatesMessage templates can be used for an email message's subject and body. Messages templates can be used for routine mailings such as canned responses, daily tasks, and reminder messages, or just to create a standard format for the body of messages.
Manage message templates from Administer > CiviMail > Message Templates.
- Click on New Message Template.
- Enter a Message Title and a Message Subject. You can choose to use tokens to personalize your subject line.
- Scroll down to the HTML Message section and create your template. There are online resources that offer instructions on creating an HTML Email Template. One suggestion is to find and copy an Email Template from a website that offers samples.
- One of the toolbar buttons at the top of this section lets you view the source code of your template. When you click on it, the template changes the view to show the HTML code that is being used. If you want to use HTML from a template you found externally, you need to switch to this view in order to paste in HTML code from the template. Make structural changes in your template in this mode as well.
Tips for creating templatesHTML email is not regular HTML. It has significant restrictions, including the need to use tables and inline CSS and not to include a background image. Here are some tips for creating a template that will look good in all mail clients:
- Table border: The HTML <table> element includes an optional border attribute. Since the default value is 0, it doesn't appear unless you choose to use it. Adding it (or editing it if it is available) and setting it to 1 (e.g., <table border="1">) allows you to see the edges of your table and helps identify potential places to fix problems. Please note that HTML email templates usually have multiple tables and nested tables (tables inside tables). Make changes one at a time and switch to the HTML view to see the results. A table usually has more than one parameter, so make sure to place spaces between parameters.
- Table cellpadding and cellspacing: these table parameters are very useful when trying to improve the readability of your email. Play with these settings in different tables and see what works for you.
- Width: Do not send an email that is wider than 600 pixels, to ensure maximum compatibility across email clients. Make sure your outermost table does not exceed 600 pixels. Do the same for any other tables inside your main table. Also make sure that the total width of each image does not exceed 600 pixels. Images have a width parameter, but they can also have a horizontal padding parameter that, if set, can increase the width of the image.
- Images: these need to be online and accessible in order for you to use them. First edit your image so that its width and height is appropriate for your email template. Next save it so that its file size is as small as possible. If you do not have image editing software, or do not know how to use it, there are free online resources that can help you resize your image.
Creating headers and footersThe mail header is the area at the top of the email, which should include elements that you want to be always displayed before the main content body, such as the logo of your organization and the title of the newsletter.
The default footer, which is always the last thing in the email, often includes the tokens required by law in some countries (unsubscription links and domain information).
You can manage headers and footers in Administer > CiviMail > "Headers, Footers, and Automated Messages". Style them to present a coherent visual identity across all your messages. Both should be configured for maximum flexibility. For example, one or more headers can be created with different images and titles that can be used for different campaigns or programs.
After headers and footers are configured, staff who prepare a new mailing will be able to select them from available headers and footers. This helps staff create more standardized mailings with elements that help your readers identify the contents of the mailing or find information.
Once your templates are ready, we strongly recommend that you test them in various email clients, such as Mozilla Thunderbird, MS Outlook, Mac Mail and web-based e-mail such as Gmail, Yahoo and Hotmail. You can create a group that includes a test contact for each of those destinations and use it each time you create a new mailing.
Because email clients can display the HTML in emall very differently, we recommended that you keep the HTML as simple as possible and use only inline CSS or tables for formatting. Include as much of the layout as possible in the templates so that each new mailing will not require too much reviewing, the template having already been tested.
In many mailings is useful to insert dynamically chosen information that is different for every recipient. This is accomplished by using mail merge tokens in your message. A list of available tokens appears in the top right corner of the message editing area.
You might need to insert information that isn't available as a token, for instance to create a joint family greeting. Creating custom tokens is a task for a developer. To find out more about working with custom tokens, refer to the discussion about custom mail merge tokens in the Hooks chapter of the Extending CiviCRM section of this book and look at the wiki: http://wiki.civicrm.org/confluence/display/CRMDOC/Mail-merge+Tokens+for+Contact+Data.