Develop > Presentation layer > Customize marketing
E-mail activities and custom activity template JSP files
E-mail activities allow business users to deliver news and promotions to customers using e-mail. This enables business users to reach customers who may not have visited the site in some time, or to keep regular customers up to date regarding up coming events or products.
E-mail activities can be either pending or delivered. They are considered pending while being created, and while awaiting delivery. Thereafter, they are considered delivered.
E-mail activities are based on templates, coded as Java Server Pages, which define the subject and content of the e-mail. The templates contain data beans, which are capable of accessing the WebSphere Commerce database to generate dynamic content, such as the individual recipients' first and last names.
The e-mail activity templates, once created, must be stored in a location accessible by the server. They must also be registered in the database by a database administrator before they are available in the business user tools.
As a site developer, when you are creating e-mail activity templates, be aware of the site's policy regarding customers opting in and opting out of receiving e-mail. In order to receive e-mail activities, the customer must have a corresponding entry in the EMLUSRRECV table. If the user does not have an entry in this table, or if the RECEIVEEML column in that table is set to '0' for the given store, the user will not receive e-mail. This is equivalent to saying that the user only receives e-mail if there is a corresponding '1' in the RECEIVEEML column for the customer in question. It should also be noted that the current product architecture does not scope a customer segment to a particular store, therefore, an entry of '0' in the STORE_ID column represents a customer being opted-out of all e-mail activities in all stores.
IBM recommends that you, as the e-mail template author, use the EmailActivityUrlHelperDataBean class to allow the recipient a one click opt-out method from receiving future e-mail activities.
- Sample JSP code: e-mail template
Use this sample JSP code snippet as a starting point to create custom e-mail templates for marketing e-mail activities. Creating a template using this JSP code snippet is an alternative to having business users create a template using the WebSphere Commerce Accelerator or Management Center user interface.
- Register a custom e-mail activity template
By registering a custom e-mail activity template in a Struts configuration file and the WebSphere Commerce database, you make the template available to business users in either the Management Center Marketing tool or WebSphere Commerce Accelerator. This task adds the custom template to the list of e-mail templates for marketing e-mails.
- Develop the content of a custom e-mail template JSP file
You can develop dynamic and personalized e-mail message content for the custom e-mail template JSP file. When developing the content, adhere to certain specification rules.
- E-mail activity delivery algorithm
E-mail activity delivery requires the JavaMail API. E-mail messages are created and delivered through the use of this API's SMTP server interface, and the object-oriented model of the standard MIME e-mail message format. Delivery is started on the day the business user specified in the e-mail activity. The WebSphere Commerce scheduler launches a job at the specified date and time which starts the e-mail activity delivery.
Related tasks
Develop the content of a custom e-mail template JSP file
Related reference
E-mail activity delivery algorithm