Overview
The announcement_list API module allows you to manage Announcement Lists and subscribers. The following options are available.
- List all Announcement Lists (announcement_list-list_lists)
- List all Announcement List subscribers (announcement_list-list_subscribers)
- Send an email to add a subscriber (announcement_list-add_subscriber)
- Remove a subscriber (announcement_list-remove_subscriber)
- Send an Announcement List (announcement_list-post_announcement)
View the following article for instructions on how to connect to the DreamHost API. You will use the instructions in this article to construct your API call.
announcement_list-list_lists
The announcement_list-list_lists command lists Announcement Lists you have on your account.
Running the command
The following command lists all Announcement Lists on your account.
https://api.dreamhost.com/?key=1A2B3C4D5E6F7G8H&cmd=announcement_list-list_lists
announcement_list-list_subscribers
The announcement_list-list_subscribers command lists all subscribers to an Announcement List.
You must specify the following values when running this command.
- listname: &listname= followed by the name of the Announcement List. This would be the List Name that appears on the Announce Lists page in your panel. For example, if the List Name in your panel shows testlist@example.com, this would be testlist.
- domain: &domain= followed by the domain of the Announcement List. For example, example.com.
Running the command
The following command lists all Announcement Lists on your account.
https://api.dreamhost.com/?key=1A2B3C4D5E6F7G8H&cmd=announcement_list-list_subscribers&listname=testlist&domain=example.com
announcement_list-add_subscriber
The announcement_list-add_subscriber command sends an opt-in email to an email address to ask them to subscribe to the Announcement List.
You must specify the following values when running this command.
- listname: &listname= followed by the name of the Announcement List. This would be the List Name that appears on the Announce Lists page in your panel. For example, if the List Name in your panel shows testlist@example.com, this would be testlist.
- domain: &domain= followed by the domain of the Announcement List. For example, example.com.
- email: &email= followed by the email address you want to subscribe. For example, newuser@example.com.
- name : &name= followed by the name. For example: John Doe.
Running the command
The following command sends an opt-in email to an email address asking them to click a link to subscribe to your Announcement Lists.
https://api.dreamhost.com/?key=1A2B3C4D5E6F7G8H&cmd=announcement_list-add_subscriber&listname=testlist&domain=example.com&email=newuser@example.com
announcement_list-remove_subscriber
The announcement_list-remove_subscriber command immediately removes an email address from an Announcement List.
You must specify the following values when running this command.
- listname: &listname= followed by the name of the Announcement List. This would be the List Name that appears on the Announce Lists page in your panel. For example, if the List Name in your panel shows testlist@example.com, this would be testlist.
- domain: &domain= followed by the domain of the Announcement List. For example, example.com.
- email: &email= followed by the email address you want to subscribe. For example, newuser@example.com.
Running the command
The following command lists all Announcement Lists on your account.
https://api.dreamhost.com/?key=1A2B3C4D5E6F7G8H&cmd=announcement_list-remove_subscriber&listname=testlist&domain=example.com&email=newuser@example.com
announcement_list-post_announcement
The announcement_list-post_announcement command posts an announcement to an Announcement List.
You must specify the following values when running this command.
- listname: &listname= followed by the name of the Announcement List. This would be the List Name that appears on the Announce Lists page in your panel. For example, if the List Name in your panel shows testlist@example.com, this would be testlist.
- domain: &domain= followed by the domain of the Announcement List. For example, example.com.
- subject (optional): &subject= followed by the subject of the message.
- message: &message= followed by the text of the message to send. If html is set as the type, you can type the HTML code directly here. For example: <h1>Header</h1><p>Paragraph</p>.
- name: &name= followed by the List Name for this list on the "Edit" list page. For example: "list name" <testlist@example.com>
-
This is the From Name field that appears on the page where you edit the Announcement List. For example, navigate to the Announce Lists page, then click the Edit button to the right. The second field is titled From Name. Copy the full list name from this field.
-
- stamp (optional): &stamp= followed by the time to send the message. For example: 2024-04-09 19:40:00.
- charset (optional): &charset= followed by the character set in which the message is encoded. For example utf-8.
- type (optional): &type= followed by the format of the message. Option are text or html.
- duplicate_ok (optional): &duplicate_ok= followed by a 1 or 0. This indicates if you allow duplicate messages to be sent.
Running the command
The following command lists all Announcement Lists on your account.
https://api.dreamhost.com/?key=1A2B3C4D5E6F7G8H&cmd=announcement_list-post_announcement&listname=testlist&domain=example.com&subject=List Subject Here&message=<h1>Header</h1><p>Paragraph</p>&name="listname" <testlist@example.com>&stamp=2021-10-05 14:45:00&charset=utf-8&type=html&duplicate_ok=1