Announcement List API commands

Announcement List API

The following documentation is officially supported by DreamHost. However, if you find any instructions in this article do not function as intended, it's possible it may be out of date. When in doubt, please contact support for further assistance.

The announcement_list API module allows you to manage Announcement Lists and subscribers.

Commands

announcement_list-list_lists

Dump a list of all Announcement Lists you have on your account(s).

Command announcement_list-list_lists
Values (none)
Result

success
account_id listname domain name start_date max_bounces num_subscribers
1 fun example.com "DH Fun" <fun@dreamhost.com> 2007-12-13 5 102
1 announcements dreamhost.com "DH Announcements" <announcements@dreamhost.com> 2001-05-09 6 302420

Possible errors (none)

announcement_list-list_subscribers

Dump a list of all subscribers to an Announcement List.

Command announcement_list-list_subscribers
Values

listname : The name of the Announcement List, like announcements
domain : The domain of the Announcement List, like example.com

Result

success
email confirmed subscribe_date name num_bounces
josh@gmail.com 1 2007-12-13 16:55:15 Josh 0
joe@hotmail.com 1 2007-12-13 16:55:08 Joe 0
john@yahoo.com 1 2007-12-19 09:16:32 John 0

Possible errors

no_listname
no_domain
no_such_listname
no_such_domain

announcement_list-add_subscriber

Sends an opt-in email to an email address to ask them to subscribe to an Announcement List.

Command announcement_list-add_subscriber
Values

listname : The name of the Announcement List, like announcements
domain : The domain of the Announcement List, like example.com
email : The email address to subscribe, like test@test.com
name : The name of the person, like Josh Jones (optional)

Result

success
sent_opt_in_email

Possible errors

no_listname
no_domain
no_such_listname
no_such_domain
no_email
invalid_email (may have specifics after a tab)
already_subscribed
email_may_not_be_added_to_any_dreamhost_list_ever
email_requested_to_be_added_in_last_two_days_already (may have specifics after a tab)
internal_error_opting_in

announcement_list-remove_subscriber

Immediately removes an email address from an Announcement List.

Command announcement_list-remove_subscriber
Values

listname : The name of the Announcement List, like announcements
domain : The domain of the Announcement List, like example.com
email : The email address to unsubscribe, like test@test.com

Result

success
unsubscribed

Possible errors

no_listname
no_domain
no_such_listname
no_such_domain
no_email
not_subscribed
internal_error_unsubscribing

announcement_list-post_announcement

Post an announcement to an Announcement List.

Command announcement_list-post_announcement
Values

listname : The name of the Announcement List, like announcements
domain : The domain of the Announcement List, like example.com
subject : The subject of the message (optional)
message : The text of the message to send
name : The name for the list to use, like: "list name" <list@example.com>
stamp : The time to send the message, like 2009-05-28 19:40:00 (optional)
charset : The character set in which the message is encoded (optional)
type : The format of the message, either text or html (optional)
duplicate_ok: Whether to allow duplicate messages to be sent, like 1 or 0 (optional)

Result

success
posted

Possible errors

no_listname
no_domain
no_such_listname
no_such_domain
message_required
invalid_stamp
invalid_type
invalid_name
duplicate_message (may have specifics after a tab)
internal_error_updating_list
internal_error_sending_mail

See also

Did this article answer your questions?

Article last updated .