[This is preliminary documentation and is subject to change.]
Namespace: ContentStudio.Document.Subscription.EventHandler
Assembly: CSSubscriptionEventHandler (in CSSubscriptionEventHandler.dll) Version: 1.0.0.0 (1.0.0.0)
Parameters
- subscriber
- Type: ContentStudio.Document.Subscription.EventHandlerSubscriptionInformation
The subscriber.
Return Value
Type: Booleantrue if the message is valid; otherwise, false
Developers can override this method when there is a need to alter the message content according to the subscriber found or make sure that the message is suited for the subscriber. This implementation replaces a number of predified strings with standard data for the subsriber (i.e. name, address and subscription key). Custom implementations should call the base class implementation at the end of the code. return base.ValidateMessage(subscriber);. To change the text body and Html body of a message use the SetMailMessageContent(String, String).
Note |
---|
If this method returns false the message will not be sent out to the subscriber. |
The following example shows how to add an information message at the top of the text body of the message
protected override bool ValidateMessage(SubscriptionInformation subscriber) { //Start by performing the standard replacement operation //in the base class if(!base.ValidateMessage(subscriber)) return false; //add your custom message to the body string body = String.Concat("This message has been processed\r\n", OriginalBody); SetMailMessageContent(OriginalHtmlBody, body); return true; }