Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • David W. 159 posts 284 karma points c-trib
    Jan 11, 2012 @ 01:42
    David W.
    0

    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...

  • Markus Johansson 1930 posts 5858 karma points MVP 2x c-trib
    Jan 11, 2012 @ 05:46
    Markus Johansson
    0

    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

  • Markus Johansson 1930 posts 5858 karma points MVP 2x c-trib
    Jan 13, 2012 @ 08:17
    Markus Johansson
    0

    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.

  • David W. 159 posts 284 karma points c-trib
    Jan 13, 2012 @ 08:20
    David W.
    0

    I've tested a bit and the razor-macro works absolutly fine. I haven't figured out how unsubscriptions are handled though?

  • Markus Johansson 1930 posts 5858 karma points MVP 2x c-trib
    Jan 13, 2012 @ 08:27
    Markus Johansson
    0

    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!

Please Sign in or register to post replies

Write your reply to:

Draft