change_domain_bulletin

The change_domain_bulletin method allows you to create, edit, or delete a domain bulletin.

If a bulletin with the specified name and type does not exist, that bulletin is created. If a bulletin with the specified name and type exists and bulletin_text is submitted in the method, the existing bulletin is changed. If a bulletin with the specified name and type exists and bulletin_text is not submitted, the existing bulletin is deleted.

Syntax

{
    <credentials object>,
    "domain": <domain>,
    "bulletin": <bulletin name>, 
    "type": auto | manual, 
    "bulletin_text": <bulletin text>
}

Request fields for change_domain_bulletin

The following fields can be used in the change_domain_bulletin method:

Field nameObligationDefinition/Value
bulletinRequiredThe name of the bulletin you want to create, edit, or delete.

Note: All bulletins in a domain must have a unique type and name. That is, it is possible for an auto bulletin and a manual bulletin to have the same name, but not for two auto bulletins to have the same name.
bulletin_textOptionalThe text of the bulletin. Bulletins must be formatted as a raw email. If the bulletin_text does not contain a Date header, a header will be appended, with the date that the bulletin was posted.

The text can include the following variables:

{'account'} — The recipient's mailbox address ([email protected]).

{'domain'} — The domain to which the user belongs (example.com).

{'name'} — The recipient's name.

{'title'} — The recipient's title.
domainRequiredThe domain to which the bulletin applies.
typeRequiredThe bulletin delivery method. Allowed values are:

auto — Bulletin is automatically sent to newly created users

manual — Bulletins are only sent via the post_domain_bulletin method.

Response fields for change_domain_bulletin

The following fields may be returned in response to the change_domain_bulletin method:

Field nameField nameDescription/Value
errorReturned if success = falseA text string that explains the error.
error_numberReturned if success = falseA number that represents the error.
successAlways returnedIndicates whether the request was successful or not. Allowed values are true and false.

Examples for change_domain_bulletin

Example 1

Creates a new auto bulletin.

Request

{
  "credentials": {
    "user": "[email protected]",
    "password": "sw0rdfish"
  },
  "company": "example.com",
	"bulletin":"Fridge",
  "type":"auto",
  "bulletin_text":
	"From: Mister Manager <[email protected]>\nSubject: Welcome!\n\nHello {'title'} {'name'},\n\nWelcome to Example Corporation, source of the worlds best demo examples.\nFYI, your email address is {'account'}\n\nPlease let me know if you need any further assistance.\n\nM. Manager"
}

Response

{
  "success": true
}

The method above results in a message that is delivered to the user that looks like this:

From: Mister Manager [email protected]
Subject: Welcome!
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Date: Thu Jan 5 20:10:20 2012

Hello Mr. Jason User,

Welcome to Example Corporation, source of the worlds best demo examples.

FYI, your email address is [email protected]

Please let me know if you need any further assistance.

M. Manager

Example 2

Edits an existing bulletin.

Request

{
  "credentials": {
    "user": "[email protected]",
    "password": "sw0rdfish"
  },
  "company": "example.com",
	"bulletin":"Fridge",
  "type":"auto",
  "bulletin_text":
	"From: Mister Manager <[email protected]>\nSubject: Welcome!\n\nHello {'title'} {'name'},\n\nWelcome to Example Corporation, source of the worlds best demo examples.\nFYI, your email address is {'account'}\n\nPlease let me know if you need any further assistance.\n\nM. Manager"
}

Response

{
  "success": true
}

Example 3

Deletes a bulletin.

Request

{
  "credentials": {
    "user": "[email protected]",
    "password": "pencil75"
  },
  "domain": "example.com",
  "bulletin": "Welcome Message",
  "type": "auto"
}

Response

{
  "success": true
}