Writing code

Your application typically uses the static Altairis.MailToolkit.MailingListManager class to use the mailing list features. The following is list of methods you can use. See the sample application SampleListManager for example, how to implement them in your application.

public static bool Subscribe(string listName, MailAddress emailAddress, params object[] additionalArgs)
Sends message requesting confirmation of subscription to given e-mail address. Returns true when message was sent, false when address is already in given mailing list. You're expected to call this method from where the user requests subscription.

The additionalArgs parameter may contain additional arguments passed during formatting to the template.

public static bool SubscribeConfirm(string listName, MailAddress emailAddress, string code)
Finishes the subscription process using the confirmation code sent to user. Returns true when user was successfully subscribed, false when subscription failed due to invalid code or because user is already in list. You're expected to call this method from the page where the user confirms subscription.

public static bool SubscribeForce(string listName, MailAddress emailAddress)
Subscribes the e-mail address to given mailing list, without sending confirmation request message. Returns true when user was successfully subscribed, false when user is already in list.

public static bool Remove(string listName, MailAddress emailAddress, params object[] additionalArgs)
Sends message requesting confirmation of removal to given e-mail address. Returns true when message was sent, false when address is already not in given mailing list. You're expected to call this method from where the user requests removal from mailing list.

The additionalArgs parameter may contain additional arguments passed during formatting to the template.

public static bool RemoveConfirm(string listName, MailAddress emailAddress, string code)
Finishes the removal process using the confirmation code sent to user. Returns true when user was successfully removed, false when removal failed due to invalid code or because user is already not in list. You're expected to call this method from the page where the user confirms removal.

public static bool RemoveForce(string listName, MailAddress emailAddress)
Removes user from mailing list, without sending confirmation request message. Returns true when user was successfully removed, false when user is already not in list.

public static void SendMessages(string listName, string subject, string body, params object[] additionalArgs)
Sends a message to all members of given mailing list.

The additionalArgs parameter may contain additional arguments passed during formatting to the template.

public static int GetMemberCount(string listName)
Gets number of e-mail addresses in given list.

Last edited Mar 23, 2012 at 8:39 PM by altair, version 2

Comments

No comments yet.