Yes! It comes with a simple razor-macro that you could tailor to your needs. It talks to the API and adds subscribers to a given mailing list. If you prefer UserControls (or XSLT) you could reuse lots of the code from the included razor-macro.
The API is in the class Newsletter.API and has these methods:
public static bool IsValidEmail(string email) Helper that checks if a string contains a valid e-mail address public static bool Subscribe(string email) Adds a subscriber with only email to the default subscription public static bool Subscribe(string email, string name) Adds a subscriber with email and name to the default subscription. public static bool Subscribe(string email, int subscriptionId) Adds a subscriber with only email to a given subscription. public static bool Subscribe(string email, string name, int subscriptionId) Adds a new subscriber to a given subscription public static bool Subscribe(Dictionary<string, string> subscribers, int subscriptionId) Adds a collection of names/addresses to a give subscription public static bool UnSubscribe(string email) Removes an subscriber from all subscriptions in the database. If its email from members section, it tries to set the newsletter-property to false. Removes an email from a given subscrptions in the database. public static bool UnSubscribe(string email, int subscription)
Question on registration control
One question, does it come with controls to use for easy member subscription/unsubscription? IE, a user puts in emailadress in box on startpage...
Hi!
Yes! It comes with a simple razor-macro that you could tailor to your needs. It talks to the API and adds subscribers to a given mailing list. If you prefer UserControls (or XSLT) you could reuse lots of the code from the included razor-macro.
/ M
Hi again Sledger!
Did you make a usercontrol? If not just want to let you know that we're planning to include one in up comming releases.
I've tested a bit and the razor-macro works absolutly fine. I haven't figured out how unsubscriptions are handled though?
Hi!
There is alot good info in the documentation: http://our.umbraco.org/FileDownload?id=3550 (take about 4 minutes to read though).
The API is in the class Newsletter.API and has these methods:
public static bool IsValidEmail(string email)
Helper that checks if a string contains a valid e-mail address
public static bool Subscribe(string email)
Adds a subscriber with only email to the default subscription
public static bool Subscribe(string email, string name)
Adds a subscriber with email and name to the default subscription.
public static bool Subscribe(string email, int subscriptionId)
Adds a subscriber with only email to a given subscription.
public static bool Subscribe(string email, string name, int subscriptionId)
Adds a new subscriber to a given subscription
public static bool Subscribe(Dictionary<string, string> subscribers, int subscriptionId)
Adds a collection of names/addresses to a give subscription
public static bool UnSubscribe(string email)
Removes an subscriber from all subscriptions in the database.
If its email from members section, it tries to set the newsletter-property to false.
Removes an email from a given subscrptions in the database.
public static bool UnSubscribe(string email, int subscription)
Happy coding!
is working on a reply...