{"_id":"56aea6ac70944b0d00c748ac","version":{"_id":"569f9cf6650e1d1900f96b5e","project":"569f9cf6650e1d1900f96b5b","__v":12,"createdAt":"2016-01-20T14:43:02.785Z","releaseDate":"2016-01-20T14:43:02.785Z","categories":["569f9cf7650e1d1900f96b5f","56abdd81d4432d1900eed235","56abe0558beeff0d003b8118","56ad2f8b1c09150d00a183a8","56ad4e1cd21f1b0d00fd2f97","56b00ad88f7a4f0d0029dc92","56b2432e9621f20d00efb2bd","56b25826147e900d00d6497a","56b7af2a4b372d2100722c48","56b8c4d938b1070d0028920f","56b8cdab14feef0d0082415d","58599813cf9e112d0032cdab"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"category":{"_id":"56ad4e1cd21f1b0d00fd2f97","pages":["56ad4e3f2a7860170013f71c","56ad512eb9ac5517006b696b","56aea6ac70944b0d00c748ac","56aead360c1cab0d009f65dd","56afdf01bc304a0d00ace1f6","56afe3db1486990d009c0f50","56afe6f1b34d210d003d9bbf","56afe729aef9a21700da0e4f","56b006d33c70b01700facf63"],"version":"569f9cf6650e1d1900f96b5e","__v":9,"project":"569f9cf6650e1d1900f96b5b","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-01-30T23:58:20.127Z","from_sync":false,"order":4,"slug":"company-methods","title":"Company methods"},"project":"569f9cf6650e1d1900f96b5b","__v":21,"githubsync":"","user":"5582e90181672a3900bb4fc7","parentDoc":null,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-02-01T00:28:28.613Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","examples":{"codes":[]},"auth":"required","params":[],"url":""},"isReference":false,"order":2,"body":"## Syntax \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n    <credentials object>,\\n    \\\"company\\\": <company_name>, \\n    \\\"bulletin\\\": <bulletin_name>, \\n    \\\"type\\\": auto | manual, \\n    \\\"bulletin_text\\\": <bulletin_text>\\n}\",\n      \"language\": \"perl\",\n      \"name\": \" \"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Request fields for change_company_bulletin\"\n}\n[/block]\nThe following fields can be used in the **change_domains** method:\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Field name\",\n    \"h-1\": \"Field name\",\n    \"h-2\": \"Definition/Value\",\n    \"0-0\": \"bulletin\",\n    \"0-1\": \"Required\",\n    \"0-2\": \"The name of the bulletin you want to create, change, or delete.\\n\\n**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.\",\n    \"1-0\": \"bulletin_text\",\n    \"1-1\": \"Optional\",\n    \"1-2\": \"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.\\n\\nThe text can include the following variables:\\n  * **{'account'}** — The recipient's mailbox address (joe_user:::at:::example.com).\\n  \\n  * **{'domain'}** — The domain to which the user belongs (example.com).\\n  \\n  * ** {'name'}** — The recipient's name.\",\n    \"2-0\": \"company\",\n    \"2-1\": \"Required\",\n    \"3-1\": \"Required\",\n    \"2-2\": \"The name of the company.\",\n    \"3-2\": \"Specify the bulletin type. Allowed values are:\\n\\n  * **auto** — The bulletin is automatically sent to new users when their accounts are created.\\n  \\n  * **manual** — The bulletin is sent only when the [post_company_bulletin](https://api-opensrs-email.readme.io/v1.0/docs/post_company_bulletin-1?bypass=8272e34bb5) method is run.\",\n    \"3-0\": \"type\"\n  },\n  \"cols\": 3,\n  \"rows\": 4\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Response fields for change_company_bulletin\"\n}\n[/block]\nThe following fields may be returned in response to the **change_company_bulletin** method:\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Field name\",\n    \"h-1\": \"Obligation\",\n    \"h-2\": \"Description/Value\",\n    \"0-0\": \"error\",\n    \"0-1\": \"Returned if **success = false**\",\n    \"0-2\": \"A text string that explains the error.\",\n    \"1-0\": \"error_number\",\n    \"1-1\": \"Returned if **success = false**\",\n    \"1-2\": \"A number that represents the error.\",\n    \"2-0\": \"success\",\n    \"2-1\": \"Always returned\",\n    \"2-2\": \"Indicates whether the request was successful or not. Allowed values are **true** and **false**.\"\n  },\n  \"cols\": 3,\n  \"rows\": 3\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Examples for change_company_bulletin\"\n}\n[/block]\n## Example 1 \n\nCreates a new auto bulletin.\n\n**Request** \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"credentials\\\": {\\n    \\\"user\\\": \\\"company_admin@example.adm\\\",\\n    \\\"password\\\": \\\"sw0rdfish\\\"\\n  },\\n  \\\"company\\\": \\\"Example corp\\\",\\n\\t\\\"bulletin\\\":\\\"Fridge\\\",\\n  \\\"type\\\":\\\"auto\\\",\\n  \\\"bulletin_text\\\":\\n\\t\\\"From: Mister Manager <mrmanager@example.com>\\\\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\\\"\\n}\",\n      \"language\": \"perl\",\n      \"name\": \"  \"\n    }\n  ]\n}\n[/block]\n**Response** \n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"success\\\": true\\n}\",\n      \"language\": \"perl\",\n      \"name\": \"  \"\n    }\n  ]\n}\n[/block]\n## Example 2\n\nEdits the an existing bulletin.\n\n**Request** \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"credentials\\\": {\\n    \\\"user\\\": \\\"company_admin@example.adm\\\",\\n    \\\"password\\\": \\\"sw0rdfish\\\"\\n  },\\n  \\\"company\\\": \\\"Example Corp\\\",\\n  \\\"bulletin\\\":\\\"Fridge\\\",\\n  \\\"type\\\":\\\"auto\\\",\\n  \\\"bulletin_text\\\":\\n\\t\\\"From: Mister Manager <mrmanager@example.com>\\\\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\\\"\\n}\",\n      \"language\": \"perl\",\n      \"name\": \"  \"\n    }\n  ]\n}\n[/block]\n**Response** \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"success\\\": true\\n}\",\n      \"language\": \"perl\",\n      \"name\": \"  \"\n    }\n  ]\n}\n[/block]\n## Example 3\n\nDeletes a bulletin.\n\n**Request** \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"credentials\\\": {\\n    \\\"user\\\": \\\"company_admin@example.adm\\\",\\n    \\\"password\\\": \\\"sw0rdfish\\\"\\n  },\\n  \\\"company\\\": \\\"Example Corp\\\",\\n  \\\"bulletin\\\":\\\"Fridge\\\",\\n  \\\"type\\\":\\\"auto\\\"\\n}\",\n      \"language\": \"perl\",\n      \"name\": \"  \"\n    }\n  ]\n}\n[/block]\n**Response** \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"success\\\": true\\n}\",\n      \"language\": \"perl\",\n      \"name\": \"  \"\n    }\n  ]\n}\n[/block]","excerpt":"The **change_company_bulletin** method creates, changes, or deletes a company-level bulletin. \n\nIf 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.","slug":"change_company_bulletin","type":"basic","title":"change_company_bulletin"}

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 [block:code] { "codes": [ { "code": "{\n <credentials object>,\n \"company\": <company_name>, \n \"bulletin\": <bulletin_name>, \n \"type\": auto | manual, \n \"bulletin_text\": <bulletin_text>\n}", "language": "perl", "name": " " } ] } [/block] [block:api-header] { "type": "basic", "title": "Request fields for change_company_bulletin" } [/block] The following fields can be used in the **change_domains** method: [block:parameters] { "data": { "h-0": "Field name", "h-1": "Field name", "h-2": "Definition/Value", "0-0": "bulletin", "0-1": "Required", "0-2": "The name of the bulletin you want to create, change, or delete.\n\n**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.", "1-0": "bulletin_text", "1-1": "Optional", "1-2": "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.\n\nThe text can include the following variables:\n * **{'account'}** — The recipient's mailbox address (joe_user@example.com).\n \n * **{'domain'}** — The domain to which the user belongs (example.com).\n \n * ** {'name'}** — The recipient's name.", "2-0": "company", "2-1": "Required", "3-1": "Required", "2-2": "The name of the company.", "3-2": "Specify the bulletin type. Allowed values are:\n\n * **auto** — The bulletin is automatically sent to new users when their accounts are created.\n \n * **manual** — The bulletin is sent only when the [post_company_bulletin](https://api-opensrs-email.readme.io/v1.0/docs/post_company_bulletin-1?bypass=8272e34bb5) method is run.", "3-0": "type" }, "cols": 3, "rows": 4 } [/block] [block:api-header] { "type": "basic", "title": "Response fields for change_company_bulletin" } [/block] The following fields may be returned in response to the **change_company_bulletin** method: [block:parameters] { "data": { "h-0": "Field name", "h-1": "Obligation", "h-2": "Description/Value", "0-0": "error", "0-1": "Returned if **success = false**", "0-2": "A text string that explains the error.", "1-0": "error_number", "1-1": "Returned if **success = false**", "1-2": "A number that represents the error.", "2-0": "success", "2-1": "Always returned", "2-2": "Indicates whether the request was successful or not. Allowed values are **true** and **false**." }, "cols": 3, "rows": 3 } [/block] [block:api-header] { "type": "basic", "title": "Examples for change_company_bulletin" } [/block] ## Example 1 Creates a new auto bulletin. **Request** [block:code] { "codes": [ { "code": "{\n \"credentials\": {\n \"user\": \"company_admin@example.adm\",\n \"password\": \"sw0rdfish\"\n },\n \"company\": \"Example corp\",\n\t\"bulletin\":\"Fridge\",\n \"type\":\"auto\",\n \"bulletin_text\":\n\t\"From: Mister Manager <mrmanager@example.com>\\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\"\n}", "language": "perl", "name": " " } ] } [/block] **Response** [block:code] { "codes": [ { "code": "{\n \"success\": true\n}", "language": "perl", "name": " " } ] } [/block] ## Example 2 Edits the an existing bulletin. **Request** [block:code] { "codes": [ { "code": "{\n \"credentials\": {\n \"user\": \"company_admin@example.adm\",\n \"password\": \"sw0rdfish\"\n },\n \"company\": \"Example Corp\",\n \"bulletin\":\"Fridge\",\n \"type\":\"auto\",\n \"bulletin_text\":\n\t\"From: Mister Manager <mrmanager@example.com>\\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\"\n}", "language": "perl", "name": " " } ] } [/block] **Response** [block:code] { "codes": [ { "code": "{\n \"success\": true\n}", "language": "perl", "name": " " } ] } [/block] ## Example 3 Deletes a bulletin. **Request** [block:code] { "codes": [ { "code": "{\n \"credentials\": {\n \"user\": \"company_admin@example.adm\",\n \"password\": \"sw0rdfish\"\n },\n \"company\": \"Example Corp\",\n \"bulletin\":\"Fridge\",\n \"type\":\"auto\"\n}", "language": "perl", "name": " " } ] } [/block] **Response** [block:code] { "codes": [ { "code": "{\n \"success\": true\n}", "language": "perl", "name": " " } ] } [/block]