change_company_bulletin

The change_company_bulletin method creates, changes, or deletes a company-level 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>,
    "company": <company_name>, 
    "bulletin": <bulletin_name>, 
    "type": auto | manual, 
    "bulletin_text": <bulletin_text>
}

Request fields for change_company_bulletin

The following fields can be used in the change_domains method:

Field name

Field name

Definition/Value

bulletin

Required

The name of the bulletin you want to create, change, or delete.

Note: All bulletins in a company 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_text

Optional

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

company

Required

The name of the company.

type

Required

Specify the bulletin type. Allowed values are:

  • auto — The bulletin is automatically sent to new users when their accounts are created.

  • manual — The bulletin is sent only when the post_company_bulletin method is run.

Response fields for change_company_bulletin

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

Field name

Obligation

Description/Value

error

Returned if success = false

A text string that explains the error.

error_number

Returned if success = false

A number that represents the error.

success

Always returned

Indicates whether the request was successful or not. Allowed values are true and false.

Examples for change_company_bulletin

Example 1

Creates a new auto bulletin.

Request

{
  "credentials": {
    "user": "[email protected]",
    "password": "sw0rdfish"
  },
  "company": "Example corp",
    "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 2

Edits the an existing bulletin.

Request

{
  "credentials": {
    "user": "[email protected]",
    "password": "sw0rdfish"
  },
  "company": "Example Corp",
  "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": "sw0rdfish"
  },
  "company": "Example Corp",
  "bulletin":"Fridge",
  "type":"auto"
}

Response

{
  "success": true
}