Encoding for e-mail transmission
For e-mail transmissions where the content must be encoded, the various messaging commands choose the encoding based on the following hierarchy:
About this task
- If the member_ID is specified
- If the member_ID is not specified
The outbound messaging task command (SendMsgCmd) uses the messaging system object (Messaging) to create and send messages. The encoding selection hierarchy depends on whether the messaging task command specifies a Member_ID (CmdSendMsg.addMember(getUserID) or not.
- If the member_ID is specifiedDetermine the proper encoding:
- Use the user's preferred language to determine the proper encoding. The UserAccessBean.getPreferredLanguageId retrieves the LANGUAGE_ID column of the USERS table, which provides the user's preferred language.
- If the user does not have language preference, use the default language of the store to
determine the proper encoding. The StoreAccessBean.getLanguageId retrieves the LANGUAGE_ID column of
the STORE table, which provides the default language of the store. The following is an example of
how to do this:
... <c:set var="preferredLanguage" value="${WCParam.usr_preferredLanguage}"/> <c:if test="${empty preferredLanguage}"> <c:set var="preferredLanguage" value="${CommandContext.languageId}"/> </c:if> ...
- If the member_ID is not specified
Use the site default language. The messaging system object (Messaging) sets the preferred language to "DefaultLang" which gets replaced with the site default language by the E-mail adapter's code.
The outbound messaging system uses JavaServer page composition templates for a number of message types (see the product documentation for more information about this topic).
- Globalization enabled e-mail messaging
When a message of one of these types is generated within WebSphere Commerce, the message composition service uses the corresponding template to create the outbound message. Once it is created, the outbound message can be sent through whatever transports have been assigned to the message type in the Administration Console.
Procedure
Results
The JSP associated with your view command generates the globalization enabled message to be delivered to the outbound messaging queue (temporarily stored in MSGSTORE table).
The following table shows examples of message types that use message composition templates. You can use these templates and their associated commands as a reference when building your own messaging commands and composition templates.
Message type | JSP template | Path |
---|---|---|
OrderCreateXMLFormat | OrderCreateXML.jsp |
|
OrderStatusNotify | OrderStatusNotify.jsp |
|
PasswordReset | PasswordResetNotification .jsp |
|
- The default name of a JSP template is registered in the struts-config.xml file. Newly customized entries should be added to struts-config-ext.xml file of the Stores.war. By design, the Inbound Messaging System in WebSphere Commerce outputs all messages (for transports such as file and MQ) in UTF-8 format. This is to allow for easy communications, since UTF-8 has become the standard computer-to-computer communication character encoding.
- WebSphere Commerce supports only UTF-8 encoding for message composition. If you encounter any issues regarding special characters that are not displaying correctly due to encoding issues, see Troubleshooting special character encoding issues in WebSphere Commerce.