Class SubscriptionMail
Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. The class that handles sending of mail notifications for subscriptions, used by SubscriptionJob.
Inheritance
Implements
Inherited Members
Namespace: EPiServer.Personalization.Internal
Assembly: EPiServer.dll
Version: 10.10.4Syntax
[SubscriptionPlugIn(DisplayName = "Default subscription handler", LanguagePath = "/admin/settings/defaultsubscriptionhandler")]
[Obsolete("The subscription feature was obsoleted in CMS 7.5 and is being phased out")]
public class SubscriptionMail : ISubscriptionHandler
Remarks
This subscription handler is going to deliver one subscription mail for each subscription root and language for the subcription, if it exists changed pages for it.
The text for the "Read More..." text is taken from the page property "MailReadMore" on the subscription root.
The subject of the mail is generated from the page property "MailSubject" on the subscription root.
The mail from address generated from the "MailFrom" page property on the subscription root.
The stylesheet is taken from the web.config
<episerver xmlns="http://EPiServer.Configuration.EPiServerSection">
<sites>
<site description="Example Site">
<siteSettings
...
uiEditorCssPaths="~/MyCss.css"
Constructors
SubscriptionMail()
Declaration
public SubscriptionMail()
SubscriptionMail(LocalizationService, ISiteDefinitionResolver)
Declaration
public SubscriptionMail(LocalizationService localizationService, ISiteDefinitionResolver siteDefinitionResolver)
Parameters
Type | Name | Description |
---|---|---|
LocalizationService | localizationService | |
ISiteDefinitionResolver | siteDefinitionResolver |
Properties
User
Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. SID
Declaration
public string User { get; set; }
Property Value
Type | Description |
---|---|
System.String |
UserData
Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. Personalized information
Declaration
public EPiServerProfile UserData { get; set; }
Property Value
Type | Description |
---|---|
EPiServerProfile |
Methods
FormatPageForBody(PageData, PageData)
Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. Format info for a page that has changed and will be included inside the body of a subscription mail.
Declaration
public virtual string FormatPageForBody(PageData subscriptionPage, PageData page)
Parameters
Type | Name | Description |
---|---|---|
PageData | subscriptionPage | The subscription page |
PageData | page | Page that holds information that needs to be be formatted |
Returns
Type | Description |
---|---|
System.String | A string that contains HTML by default |
GenerateBody(PageData, PageDataCollection)
Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. Create the Html for the subscription mail body.
Declaration
public virtual string GenerateBody(PageData subscriptionPage, PageDataCollection changedPagesReadOnly)
Parameters
Type | Name | Description |
---|---|---|
PageData | subscriptionPage | The subscription template page. |
PageDataCollection | changedPagesReadOnly | A collection of readonly pages that have changed. |
Returns
Type | Description |
---|---|
System.String | The complete Html for the mail body ("<html>.... </html>"). |
Remarks
Call the GetCSSContents() function to fetch any CSS data that should be included in the html.
GetCSSContents()
Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. Return the CSS data that is included in the subscription mail. By default this means fetching the contents of the file defined by the key EPsEditCSS in web.config. Any C style comments are automatically removed from the string before it is returned.
Declaration
public virtual string GetCSSContents()
Returns
Type | Description |
---|---|
System.String | A string with CSS data |
Remarks
Do not include any <style> tags in the string that is returned.
IsValidEmailAddress(String)
Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. Check if an email address conforms to the RFC 2822 email address protocol. For more information, see http://rfc.net/rfc2822.html.
Declaration
public virtual bool IsValidEmailAddress(string address)
Parameters
Type | Name | Description |
---|---|---|
System.String | address | Email address to check |
Returns
Type | Description |
---|---|
System.Boolean | True if valid address, otherwise false |
Send(PageData, PageDataCollection)
Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. Send an e-mail to user with information about changed pages.
Declaration
public virtual void Send(PageData subscriptionRootPage, PageDataCollection changedPages)
Parameters
Type | Name | Description |
---|---|---|
PageData | subscriptionRootPage | The root page for the subscription that this mail should be based on |
PageDataCollection | changedPages | The changed pages to notify the user about |
Remarks
Create the subscription part of the body by calling the GenerateBody(PageData, PageDataCollection) function.