Note! You are looking at documentation for an old version of the package. Go here for the latest documentation.

Can be used to hook into other systems or data sources. Newsletter Studio will use the providers to fetch the needed information about the receivers. All current subscriptions options (Newsletter Studios native mailing list and Umbraco members) are build with providers and it's easy to implement you own.

Subscription -providers

As you can see the subscription providers make is possible to connect to any source, you could for example create a mailing list for all customers in the e-commerce that hasn't placed any others the past 4 months and the send them an offer. These filters are configured inside your custom subscription provider, or if you need multiple your subscription providers.
 

How to implement

To create your own subscription provider you need to create a new class that inherits the abstract class NewsletterStudio.Bll.Providers.SubscriptionProviderBase.
This class contains some properties and methods that you must override:

  • UniqName 
    A string that contains a unique name for your custom provider. Use company name, project name or whatever. Must be unique.
  • DisplayName 
    A friendly name of your provider that will be shown in dropdowns and other display areas. Ex. "eCommerce Customers"
  • GetListItems 
    This method should return all your lists of subscribers, the provider can have as many lists as you like but must contain at least one. Here we can use ie, "All customers" , "Customer inactive (4 months), New customers (last week)".
  • GetSubscribersForSendOut 
    This method will go and actually fetch the subscribers for you course. The ListItems value property will be sent as parameter and for you to use for filtering.
  • Unsubscribe
    If your source supports unsubscribing put the logic here.
  • CanEditSubscriber
    Used in the error-list on the analytics page, if your source has some kind of edit-page for the receivers', set this property to true.
  • GetEditUrl
    If "CanEditSubscriber" is set to true, Newsletter Studio will try to fetch the edit url from this method if needed.
 
Newsletter _tree


​When you have created your provider, build it, put the dll in the bin-folder and add the right assembly information to /config/newsletterstudio.config.



One thing to notice is that the provider will not generate a new mailing list in the application tree, it will only add new options to the dropdown lists when sending the newsletter.




Newsletter _send _out

For examples and inspiration, have a look at the Newsletter Studio Contrib-project at GitHub:  https://github.com/enkelmedia/NewsletterStudioContrib



More articles on "Develop with Newsletter Studio"

Control content with Render Tasks

Using a render task an developer can hook into the rendering process of the email and make changes to the message body/subject. This can be done both on an overall level and on each individual email (ie. personalization). This feature could for example be used to replace [sometext] inside the messag…

Read article

Frontend API

To interact with Newsletter Studio from the front end we provide a very simple API in the static class NewsletterStudio.Api. This class has several methods for adding and removing subscribers both from the built in subscriptions and from Umbraco's member section (it won't delete anything but it chan…

Read article

Events

Since version 1.4.5 and 2.1 Newletter Studio contains some events that you as a developer can use when you develop your solutions.  Event name v1.4.5+ v2.1+ NewsletterStudio.Services.SendNewsletterService.SendningInitializing Yes Yes NewsletterStudio.Services.SendNewsletterService.Sent Yes Ye…

Read article

Custom data fields

The default property fields for receivers in Newsletter Studio are: name, e-mail, subscribed date and status. But some clients want to add custom data to their contacts.Since version 2.1 we've decided to prepare the underlying data layer for this by adding a new property called “Data” on the Receive…

Read article

Working programmatically

There is a lot of things that can be done using the services and repositories that Newsletter Studio provides. You can explore these APIs using the "GlobalFactory" which is a service locator that the package uses internally. For example, you can access the Mailing List Repository like this: Newslett…

Read article