PHPackages                             ocolin/open-srs-mail - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. ocolin/open-srs-mail

ActiveLibrary[HTTP &amp; Networking](/categories/http)

ocolin/open-srs-mail
====================

REST Client for OpenSRS Email API

v2.0.2(2mo ago)04MITPHPPHP &gt;=8.3

Since Apr 28Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/ocolin/OpenSrsMail)[ Packagist](https://packagist.org/packages/ocolin/open-srs-mail)[ RSS](/packages/ocolin-open-srs-mail/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (9)Versions (10)Used By (0)

OpenSRS Email
=============

[](#opensrs-email)

What is it?
-----------

[](#what-is-it)

This is a small PHP client for accessing Open SRS's Email hosting API services.

It's designed so you can set to make using the API services quickly and easily, as well as provide very good documentation to help along the way using detailed PHPDoc information taken from the user manual.

Here is a link to the OpenSRS manual for reference: [Manual](https://email.opensrs.guide/docs/)

---

Table Of Contents
-----------------

[](#table-of-contents)

- [What is it?](#What-is-it?)
- [Requirements](#Requirements)
- [Installation](#Installation)
- [Configuration](#Configuration)
- [Response object](#Response-object)
- [REQUEST METHOD](#REQUEST-METHOD)
- [User Methods](#User-Methods)
    - [changeUser](#changeUser)
    - [deleteUser](#deleteUser)
    - [generateToken](#generateToken)
    - [getDeletedContacts](#getDeletedContacts)
    - [getDeletedMessages](#getDeletedMessages)
    - [getUser](#getUser)
    - [getUserAttributeHistory](#getUserAttributeHistory)
    - [getUserChanges](#getUserChanges)
    - [getUserFolders](#getUserFolders)
    - [getUserMessages](#getUserMessages)
    - [logoutUser](#logoutUser)
    - [moveUserMessages](#moveUserMessages)
    - [reindex](#reindex)
    - [renameUser](#renameUser)
    - [restoreDeletedContacts](#restoreDeletedContacts)
    - [restoreDeletedMessages](#restoreDeletedMessages)
    - [restoreUser](#restoreUser)
    - [searchUsers](#searchUsers)
    - [setRole](#setRole)
    - [userNotify](#userNotify)
    - [appPassword](#appPassword)
    - [resetEmailTest](#resetEmailTest)
    - [getSieve](#getSieve)
    - [setSieve](#setSieve)
- [Stats Methods](#Stats-Methods)
    - [statsList](#statsList)
    - [statsSnapshot](#statsSnapshot)
    - [statsSummary](#statsSummary)
- [Domain Methods](#Domain-Methods)
    - [changeDomain](#changeDomain)
    - [changeDomainBulletin](#changeDomainBulletin)
    - [deleteDomain](#deleteDomain)
    - [getDomain](#getDomain)
    - [getDomainBulletin](#getDomainBulletin)
    - [postDomainBulletin](#postDomainBulletin)
    - [restoreDomain](#restoreDomain)
    - [searchDomains](#searchDomains)
    - [pushDomain](#pushDomain)
- [Company Methods](#Company-Methods)
    - [changeCompany](#changeCompany)
    - [changeCompanyBulletin](#changeCompanyBulletin)
    - [getCompany](#getCompany)
    - [getCompanyBulletin](#getCompanyBulletin)
    - [getCompanyChanges](#getCompanyChanges)
    - [postCompanyBulletin](#postCompanyBulletin)
- [Brand Methods](#Brand-Methods)
    - [searchBrands](#searchBrands)
    - [searchBrandMembers](#searchBrandMembers)
- [Workgroup Methods](#Workgroup-Methods)
    - [createWorkgroup](#createWorkgroup)
    - [deleteWorkgroup](#deleteWorkgroup)
    - [searchWorkgroups](#searchWorkgroups)
- [Authentication Methods](#Authentication-Methods)
    - [authenticate](#authenticate)
    - [echo](#echo)
- [Migration Methods](#Migration-Methods)
    - [migrationAdd](#migrationAdd)
    - [migrationJobs](#migrationJobs)
    - [migrationStatus](#migrationStatus)
    - [migrationTrace](#migrationTrace)

---

Requirements
------------

[](#requirements)

- PHP ^8.3
- guzzlehttp/guzzle ^7.10
- ocolin/global-type ^2.0
-

---

Installation
------------

[](#installation)

```
composer require ocolin/open-srs-mail

```

---

Configuration
-------------

[](#configuration)

There are two ways to configure the client. One is through Environment variables and the other is through constructor arguments. Here is a list of the parameters:

Env NamesArg NamesTypeDefaultDescriptionOPENSRS\_MAIL\_HOST$hoststringtest serverName of OpenSRS serverOPENSRS\_MAIL\_USERNAME$usernamestringN/AUsername to log in asOPENSRS\_MAIL\_PASSWORD$passwordstringN/APassword for log inOPENSRS\_MAIL\_MODE$modestringTOKENWhether to use a password or tokenOPENSRS\_MAIL\_TOKEN\_EXPIRATION$token\_expirationinteger10800How long token will last. Up to 24 hours.OPENSRS\_MAIL\_CACHE\_PATH$cache\_pathstringsystem temp filesWhere to store a temporary token.### Host

[](#host)

Open SRS has 3 servers. One for testing, one for their A cluster, and one for their B cluster. If no server is specified it will result in the test server being used. There are also shortcuts for the 3 servers for eas of use.

Shortcut valueServerTESTABOr you can specify a different server should OpenSRS add others in the future, or if you want to manually enter an existing an OpenSRS server.

### Mode

[](#mode)

OpenSRS has two authentication methods.

#### PASSWORD

[](#password)

In password mode, you submit your username and password for every request. With this client you only set them once, but they are sent with every request. The downside to this method is that each API call takes longer as it has to validate the authentication each time.

#### TOKEN

[](#token)

In Token mode, the default, a temporary token is used and stored for each request. This improves API call time as the token is already validated. This client will automatically handle renewing the tokens for you so you don't have to worry about it.

#### TOKEN EXPIRATION

[](#token-expiration)

The default token life is 10800 seconds. But you can use this property if you want to customize it.

This is optional only used in TOKEN mode.

#### CACHE PATH

[](#cache-path)

By default, this client will use your system temp file folder to store tokens. This property allows you to override that and use a custom storage location.

This is optional only used in TOKEN mode.

### Configuring with environment variables

[](#configuring-with-environment-variables)

```
// Manually setting vars for demonstration purposes
$_ENV['OPENSRS_MAIL_HOST'] = 'https://admin.test.hostedemail.com/api';
$_ENV['OPENSRS_MAIL_USERNAME'] = 'opensrs@mydomain.adm';
$_ENV['OPENSRS_MAIL_PASSWORD'] = '12345abc!@#';
// OPTIONAL PARAMETERS
$_ENV['OPENSRS_MAIL_MODE'] = 'TOKEN';
$_ENV['OPENSRS_MAIL_TOKEN_EXPIRATION'] = '600';
$_ENV['OPENSRS_MAIL_CACHE_PATH'] = '/tmp/';

$opensrs = new Ocolin\OpenSrsMail\Client();
```

### Configuring with constructor arguments

[](#configuring-with-constructor-arguments)

Configuration uses a Config class to store your settings.

```
$opensrs = new Ocolin\OpenSrsMail\Client(
    client: new Ocolin\OpenSrsMail\Config(
        host: 'https://admin.test.hostedemail.com/api',
        username: 'opensrs@mydomain.adm',
        password: '12345abc!@#',
        // OPTIONAL
        mode: 'TOKEN',
        token_expiration: 600,
        cache_path: '/tmp/'
    )
);
```

### Options

[](#options)

You can also pass some guzzle HTTP configuration options along such as timeouts or verifying SSL to override defaults if needed.

```
$opensrs = new Ocolin\OpenSrsMail\Client(
    client: new Ocolin\OpenSrsMail\Config(
        options: [ 'timeout' => 60, 'verify'] => false
    )
);
```

---

Response object
---------------

[](#response-object)

This client passes along the object from the server as it exists. To see what response to expect, see the OpenSRS documentation.

---

REQUEST METHOD
--------------

[](#request-method)

The client has a single generic request method that can be used to manually call any endpoint on the OpenSRS API server. While not intended to be used by default, it exists in case OpenSRS adds new endpoints, if any are missing, or if any are not working properly.

```
$response = $opensrs->request(
    method: 'get_company',
    params: [ 'company' => 'myCompanyName' ]
);
```

There are two parameters. One is the method for the OpenSRS server, and the others is an array or object with the parameters and values to send to the server.

### Conventions

[](#conventions)

The OpenSRS api use snake case for names. This client uses camelCase instead. So anything in the manual using snake case just needs to be converted to camelCase.

Example: delete\_user is deleteUser. create\_only property is createOnly.

Knowing this will help you not have to rely on this help doc as much.

---

User Methods
------------

[](#user-methods)

### changeUser

[](#changeuser)

```
$output = $opensrs->changeUser(...);
```

#### Manual

[](#manual)

[https://email.opensrs.guide/docs/change\_user](https://email.opensrs.guide/docs/change_user)

#### Arguments

[](#arguments)

ArgumentRequiredTypeDescription$userYESstringThe user that you want to create or modify.$attributesYESobject|arraThe list of fields that you want to define or modify and their new values.$createOnlyNObooleanUsed to prevent changes to existing accounts.### deleteUser

[](#deleteuser)

```
$output = $opensrs->deleteUser(...);
```

#### Manual

[](#manual-1)

[https://email.opensrs.guide/docs/delete\_user](https://email.opensrs.guide/docs/delete_user)

#### Arguments

[](#arguments-1)

ArgumentRequiredTypeDescription$userYESstringThe user that you want to delete.### generateToken

[](#generatetoken)

```
$output = $opensrs->generateToken(...);
```

#### Manual

[](#manual-2)

[https://email.opensrs.guide/docs/generate\_token](https://email.opensrs.guide/docs/generate_token)

#### Arguments

[](#arguments-2)

ArgumentRequiredTypeDescription$userYESstringThe user's mailbox name.$reasonYESstringThe reason that the token was generated.$durationNOintThe number of hours for which the token is valid.$omaNOboolIf set to true, a session or sso type token may used with OMA$tokenNOstringThe token to add.$typeNOstringThe type of token to generate.### getDeletedContacts

[](#getdeletedcontacts)

```
$output = $opensrs->getDeletedContacts(...);
```

#### Manual

[](#manual-3)

[https://email.opensrs.guide/docs/get\_deleted\_contacts](https://email.opensrs.guide/docs/get_deleted_contacts)

#### Arguments

[](#arguments-3)

ArgumentRequiredTypeDescription$userYESstringThe user's mailbox name.### getDeletedMessages

[](#getdeletedmessages)

```
$output = $opensrs->getDeletedMessages(...);
```

#### Manual

[](#manual-4)

[https://email.opensrs.guide/docs/get\_deleted\_messages](https://email.opensrs.guide/docs/get_deleted_messages)

#### Arguments

[](#arguments-4)

ArgumentRequiredTypeDescription$userYESstringThe user's mailbox name.$headersNOarraySpecify the headers that you want returned.$folderNOstringName of the folder to search.### getUser

[](#getuser)

```
$output = $opensrs->getUser(...);
```

#### Manual

[](#manual-5)

[https://email.opensrs.guide/docs/get\_user](https://email.opensrs.guide/docs/get_user)

#### Arguments

[](#arguments-5)

ArgumentRequiredTypeDescription$userYESstringThe user's mailbox name.### getUserAttributeHistory

[](#getuserattributehistory)

```
$output = $opensrs->getUserAttributeHistory(...);
```

#### Manual

[](#manual-6)

[https://email.opensrs.guide/docs/get\_user\_attribute\_history](https://email.opensrs.guide/docs/get_user_attribute_history)

#### Arguments

[](#arguments-6)

ArgumentRequiredTypeDescription$userYESstringThe user's mailbox name.$attributeYESstringThe name of the attribute to query.### getUserChanges

[](#getuserchanges)

```
$output = $opensrs->getUserChanges(...);
```

#### Manual

[](#manual-7)

[https://email.opensrs.guide/docs/get\_user\_changes](https://email.opensrs.guide/docs/get_user_changes)

#### Arguments

[](#arguments-7)

ArgumentRequiredTypeDescription$userYESstringThe user's mailbox name.$rangeFirstNOintThe 0-based index of the first result to return.$rangeLimitNOintThe maximum number of results to return.### getUserFolders

[](#getuserfolders)

```
$output = $opensrs->getUserFolders(...);
```

#### Manual

[](#manual-8)

[https://email.opensrs.guide/docs/get\_user\_folders](https://email.opensrs.guide/docs/get_user_folders)

#### Arguments

[](#arguments-8)

ArgumentRequiredTypeDescription$userYESstringThe user's mailbox name.### getUserMessages

[](#getusermessages)

```
$output = $opensrs->getUserMessages(...);
```

#### Manual

[](#manual-9)

[https://email.opensrs.guide/docs/get\_user\_messages](https://email.opensrs.guide/docs/get_user_messages)

#### Arguments

[](#arguments-9)

ArgumentRequiredTypeDescription$userYESstringThe user's mailbox name.$folderNOstringThe folder to search for messages.$limitNOintSpecify the number of messages to return.$recentNOboolOrders the results starting by most recent$unseenNOboolReturn a list of only those messages that have been delivered to the user.### logoutUser

[](#logoutuser)

```
$output = $opensrs->logoutUser(...);
```

#### Manual

[](#manual-10)

[https://email.opensrs.guide/docs/logout\_user](https://email.opensrs.guide/docs/logout_user)

#### Arguments

[](#arguments-10)

ArgumentRequiredTypeDescription$userYESstringThe user's mailbox name.### moveUserMessages

[](#moveusermessages)

```
$output = $opensrs->moveUserMessages(...);
```

#### Manual

[](#manual-11)

[https://email.opensrs.guide/docs/move\_user\_messages](https://email.opensrs.guide/docs/move_user_messages)

#### Arguments

[](#arguments-11)

ArgumentRequiredTypeDescription$userYESstringThe user's mailbox name.$idsYESarrayThe list of ids that you want to move.$folderNOstringThe folder to search for messages.### reindex

[](#reindex)

```
$output = $opensrs->reindex(...);
```

#### Manual

[](#manual-12)

#### Arguments

[](#arguments-12)

ArgumentRequiredTypeDescription$userYESstringThe user's mailbox name.$idsYESarrayThe list of ids that you want to move.$folderNOstringThe folder to search for messages.### renameUser

[](#renameuser)

```
$output = $opensrs->renameUser(...);
```

#### Manual

[](#manual-13)

[https://email.opensrs.guide/docs/rename\_user](https://email.opensrs.guide/docs/rename_user)

#### Arguments

[](#arguments-13)

ArgumentRequiredTypeDescription$userYESstringThe user's mailbox name.$newNameYESstringThe new name for the mailbox.### restoreDeletedContacts

[](#restoredeletedcontacts)

```
$output = $opensrs->restoreDeletedContacts(...);
```

#### Manual

[](#manual-14)

[https://email.opensrs.guide/docs/restore\_deleted\_contacts](https://email.opensrs.guide/docs/restore_deleted_contacts)

#### Arguments

[](#arguments-14)

ArgumentRequiredTypeDescription$userYESstringThe user's mailbox name.$idsYESarrayThe IDs for the messages that you want to restore.### restoreDeletedMessages

[](#restoredeletedmessages)

```
$output = $opensrs->restoreDeletedMessages(...);
```

#### Manual

[](#manual-15)

[https://email.opensrs.guide/docs/restore\_deleted\_messages](https://email.opensrs.guide/docs/restore_deleted_messages)

#### Arguments

[](#arguments-15)

ArgumentRequiredTypeDescription$userYESstringThe user's mailbox name.$idsYESarrayThe IDs for the messages that you want to restore.### restoreUser

[](#restoreuser)

```
$output = $opensrs->restoreUser(...);
```

#### Manual

[](#manual-16)

[https://email.opensrs.guide/docs/restore\_user](https://email.opensrs.guide/docs/restore_user)

#### Arguments

[](#arguments-16)

ArgumentRequiredTypeDescription$userYESstringThe user's mailbox name.$newNameYESstringRename the restored account.$idYESstringA unique ID that identifies the user.### searchUsers

[](#searchusers)

```
$output = $opensrs->searchUsers(...);
```

#### Manual

[](#manual-17)

[https://email.opensrs.guide/docs/search\_users](https://email.opensrs.guide/docs/search_users)

#### Arguments

[](#arguments-17)

ArgumentRequiredTypeDescription$criteriaYESarrayNarrows the results$fieldsNOarrayAdditional fields to return.$rangeFirstNOintSpecify the first user to return.$rangeLimitNOintSpecify the maximum number of users to return.$sortNOarrayetermines the way in which to sort results.### setRole

[](#setrole)

```
$output = $opensrs->setRole(...);
```

#### Manual

[](#manual-18)

[https://email.opensrs.guide/docs/set\_role](https://email.opensrs.guide/docs/set_role)

#### Arguments

[](#arguments-18)

ArgumentRequiredTypeDescription$userYESstringThe user to whom you are assigning a role.$roleYESstringThe name of the role.$objectYESarray|stringThe object over which the user will have rights.### userNotify

[](#usernotify)

```
$output = $opensrs->userNotify(...);
```

#### Manual

[](#manual-19)

[https://email.opensrs.guide/docs/user\_notify](https://email.opensrs.guide/docs/user_notify)

#### Arguments

[](#arguments-19)

ArgumentRequiredTypeDescription$userYESstringThe user's mailbox name.### userDisable2fa

[](#userdisable2fa)

```
$output = $opensrs->userDisable2fa(...);
```

#### Manual

[](#manual-20)

[https://email.opensrs.guide/docs/user\_disable\_2fa](https://email.opensrs.guide/docs/user_disable_2fa)

#### Arguments

[](#arguments-20)

ArgumentRequiredTypeDescription$userYESstringThe user's mailbox name.### appPassword

[](#apppassword)

```
$output = $opensrs->appPassword(...);
```

#### Manual

[](#manual-21)

[https://email.opensrs.guide/docs/app\_password](https://email.opensrs.guide/docs/app_password)

#### Arguments

[](#arguments-21)

ArgumentRequiredTypeDescription$userYESstringThe user's mailbox name.$modeYESstringA string, either "add" or "remove".$tagNOstringA string. for "add", the tag name desired for this new App Password.### resetEmailTest

[](#resetemailtest)

```
$output = $opensrs->resetEmailTest(...);
```

#### Manual

[](#manual-22)

[https://email.opensrs.guide/docs/reset\_email\_test](https://email.opensrs.guide/docs/reset_email_test)

#### Arguments

[](#arguments-22)

ArgumentRequiredTypeDescription$testEmailRcptYESstringEmail ID where test emails will be sent.$brandYESstringBrand id or brand name.$companyNOstringEither a company id or company name.### getSieve

[](#getsieve)

```
$output = $opensrs->getSieve(...);
```

#### Manual

[](#manual-23)

[https://email.opensrs.guide/docs/get\_sieve](https://email.opensrs.guide/docs/get_sieve)

#### Arguments

[](#arguments-23)

ArgumentRequiredTypeDescription$userYESstringThe user's mailbox name.### setSieve

[](#setsieve)

```
$output = $opensrs->setSieve(...);
```

#### Manual

[](#manual-24)

[https://email.opensrs.guide/docs/set\_sieve](https://email.opensrs.guide/docs/set_sieve)

### Arguments

[](#arguments-24)

ArgumentRequiredTypeDescription$userYESstringThe user's mailbox name.$rulesetYESstringRuleset to set.$dataNOstringRule data$activeRuleNOstringSet active rule---

Stats Methods
-------------

[](#stats-methods)

### statsList

[](#statslist)

```
$output = $opensrs->statsList(...);
```

#### Manual

[](#manual-25)

[https://email.opensrs.guide/docs/stats\_list](https://email.opensrs.guide/docs/stats_list)

No arguments.

### statsSnapshot

[](#statssnapshot)

```
$output = $opensrs->statsSnapshot(...);
```

#### Manual

[](#manual-26)

[https://email.opensrs.guide/docs/stats\_snapshot](https://email.opensrs.guide/docs/stats_snapshot)

#### Arguments

[](#arguments-25)

ArgumentRequiredTypeDescription$typeYESstringThe type of entity for which you want to see statistics.$objectYESstringThe name of the company or domain.$dateYESstringThe date for which you want to see statistics.### statsSummary

[](#statssummary)

```
$output = $opensrs->statsSummary(...);
```

#### Manual

[](#manual-27)

[https://email.opensrs.guide/docs/stats\_summary](https://email.opensrs.guide/docs/stats_summary)

#### Arguments

[](#arguments-26)

ArgumentRequiredTypeDescription$byNOstringThe interval that you want displayed in the response.$typeNOstringThe type of object.$objectNOstringThe name of the company, domain, or user to get statistics.---

Domain methods
--------------

[](#domain-methods)

### changeDomain

[](#changedomain)

```
$output = $opensrs->changeDomain(...);
```

#### Manual

[](#manual-28)

[https://email.opensrs.guide/docs/change\_domain](https://email.opensrs.guide/docs/change_domain)

#### Arguments

[](#arguments-27)

ArgumentRequiredTypeDescription$domainYESstringThe domain that you want to create or change.$attributesYESarray|objectThe list of fields to configure.$createOnlyNOboolUsed to prevent changes to existing domains.### changeDomainBulletin

[](#changedomainbulletin)

```
$output = $opensrs->changeDomainBulletin(...);
```

#### Manual

[](#manual-29)

[https://email.opensrs.guide/docs/change\_domain\_bulletin](https://email.opensrs.guide/docs/change_domain_bulletin)

#### Arguments

[](#arguments-28)

ArgumentRequiredTypeDescription$domainYESstringThe domain name.$bulletinYESstringThe name of the bulletin you want to create, edit, or delete.$typeYESstringThe bulletin delivery method.$bulletinTextNOstringhe text of the bulletin.### deleteDomain

[](#deletedomain)

```
$output = $opensrs->deleteDomain(...);
```

#### Manual

[](#manual-30)

[https://email.opensrs.guide/docs/delete\_domain](https://email.opensrs.guide/docs/delete_domain)

#### Arguments

[](#arguments-29)

ArgumentRequiredTypeDescription$domainYESstringThe domain name.### getDomain

[](#getdomain)

```
$output = $opensrs->getDomain(...);
```

#### Manual

[](#manual-31)

[https://email.opensrs.guide/docs/get\_domain](https://email.opensrs.guide/docs/get_domain)

#### Arguments

[](#arguments-30)

ArgumentRequiredTypeDescription$domainYESstringThe domain name.### getDomainBulletin

[](#getdomainbulletin)

```
$output = $opensrs->getDomainBulletin(...);
```

#### Manual

[](#manual-32)

[https://email.opensrs.guide/docs/get\_domain\_bulletin](https://email.opensrs.guide/docs/get_domain_bulletin)

#### Arguments

[](#arguments-31)

ArgumentRequiredTypeDescription$domainYESstringThe domain name.$bulletinYESstringThe name of the bulletin you want to view.$typeYESstringThe type of bulletin.### postDomainBulletin

[](#postdomainbulletin)

```
$output = $opensrs->postDomainBulletin(...);
```

#### Manual

[](#manual-33)

[https://email.opensrs.guide/docs/post\_domain\_bulletin](https://email.opensrs.guide/docs/post_domain_bulletin)

### Arguments

[](#arguments-32)

ArgumentRequiredTypeDescription$domainYESstringThe domain name.$bulletinYESstringThe name of the bulletin you want to view.$typeYESstringThe bulletin type.$testEmailNOstringSend the bulletin to only the specified email.### restoreDomain

[](#restoredomain)

```
$output = $opensrs->restoreDomain(...);
```

#### Manual

[](#manual-34)

[https://email.opensrs.guide/docs/restore\_domain](https://email.opensrs.guide/docs/restore_domain)

### Arguments

[](#arguments-33)

ArgumentRequiredTypeDescription$domainYESstringThe domain name.$newNameYESstringThe new name for the domain.$idYESstring|intThe domain id.### searchDomains

[](#searchdomains)

```
$output = $opensrs->searchDomains(...);
```

#### Manual

[](#manual-35)

[https://email.opensrs.guide/docs/search\_domains](https://email.opensrs.guide/docs/search_domains)

#### Arguments

[](#arguments-34)

ArgumentRequiredTypeDescription$criteriaNOarray|objectNarrows the results.$sortNOarray|objectSort the return display.$rangeFirstNOintSpecify the first domain to return$rangeLimitNOintSpecify the maximum number of results to return.### pushDomain

[](#pushdomain)

```
$output = $opensrs->pushDomain(...);
```

#### Manual

[](#manual-36)

[https://email.opensrs.guide/docs/push\_domain](https://email.opensrs.guide/docs/push_domain)

#### Arguments

[](#arguments-35)

ArgumentRequiredTypeDescription$domainYESstringThe domain name.$newCompanyYESstringcompany\_id of the company that will receive the domain and mailboxes.---

Company Methods
---------------

[](#company-methods)

### changeCompany

[](#changecompany)

```
$output = $opensrs->changeCompany(...);
```

#### Manual

[](#manual-37)

[https://email.opensrs.guide/docs/change\_company](https://email.opensrs.guide/docs/change_company)

#### Arguments

[](#arguments-36)

ArgumentRequiredTypeDescription$companyYESstringThe name of the company.$attributesYESarray|objectA hash of company level attributes and values.### changeCompanyBulletin

[](#changecompanybulletin)

```
$output = $opensrs->changeCompanyBulletin(...);
```

#### Manual

[](#manual-38)

[https://email.opensrs.guide/docs/change\_company\_bulletin](https://email.opensrs.guide/docs/change_company_bulletin)

#### Arguments

[](#arguments-37)

ArgumentRequiredTypeDescription$companyYESstringThe name of the company.$bulletinYESstringThe name of the bulletin you want to create, change, or delete.$typeYESstringSpecify the bulletin type$bulletinTextNOstringThe bulletin is sent only when the post\_company\_bulletin method is run.### getCompany

[](#getcompany)

```
$output = $opensrs->getCompany(...);
```

#### Manual

[](#manual-39)

[https://email.opensrs.guide/docs/get\_company](https://email.opensrs.guide/docs/get_company)

#### Arguments

[](#arguments-38)

ArgumentRequiredTypeDescription$companyYESstringThe name of the company.### getCompanyBulletin

[](#getcompanybulletin)

```
$output = $opensrs->getCompanyBulletin(...);
```

#### Manual

[](#manual-40)

[https://email.opensrs.guide/docs/get\_company\_bulletin](https://email.opensrs.guide/docs/get_company_bulletin)

#### Arguments

[](#arguments-39)

ArgumentRequiredTypeDescription$companyYESstringThe name of the company.$bulletinYESstringThe name of the bulletin you want to view.$typeYESstringSpecify the bulletin type.### getCompanyChanges

[](#getcompanychanges)

```
$output = $opensrs->getCompanyChanges(...);
```

#### Manual

[](#manual-41)

[https://email.opensrs.guide/docs/get\_company\_changes](https://email.opensrs.guide/docs/get_company_changes)

#### Arguments

[](#arguments-40)

ArgumentRequiredTypeDescription$companyYESstringThe name of the company.$rangeFirstNOintThe 0-based index of the first result to return.$rangeLimitNOintThe maximum number of results to return.### postCompanyBulletin

[](#postcompanybulletin)

```
$output = $opensrs->postCompanyBulletin(...);
```

#### Manual

[](#manual-42)

[https://email.opensrs.guide/docs/post\_company\_bulletin-1](https://email.opensrs.guide/docs/post_company_bulletin-1)

#### Arguments

[](#arguments-41)

ArgumentRequiredTypeDescription$companyYESstringThe name of the company.$bulletinYESstringThe name of the bulletin you want to view.$typeYESstringSpecify the bulletin type.$testEmailNOstringSends the bulletin to only the specified email.---

Brand Methods
-------------

[](#brand-methods)

### searchBrands

[](#searchbrands)

```
$output = $opensrs->searchBrands(...);
```

#### Manual

[](#manual-43)

[https://email.opensrs.guide/docs/search\_brands](https://email.opensrs.guide/docs/search_brands)

#### Arguments

[](#arguments-42)

ArgumentRequiredTypeDescription$criteriaNOarray|objectNarrows the search for brands.$rangeFirstNOintThe 0-based index of the first result to return.$rangeLimitNOintThe maximum number of results to return.### searchBrandMembers

[](#searchbrandmembers)

```
$output = $opensrs->searchBrandMembers(...);
```

#### Manual

[](#manual-44)

[https://email.opensrs.guide/docs/search\_brand\_members](https://email.opensrs.guide/docs/search_brand_members)

#### Arguments

[](#arguments-43)

ArgumentRequiredTypeDescription$criteriaNOarray|objectNarrows the search for brands.$rangeFirstNOintThe 0-based index of the first result to return.$rangeLimitNOintThe maximum number of results to return.---

Workgroup Methods
-----------------

[](#workgroup-methods)

### createWorkgroup

[](#createworkgroup)

```
$output = $opensrs->createWorkgroup(...);
```

#### Manual

[](#manual-45)

[https://email.opensrs.guide/docs/create\_workgroup](https://email.opensrs.guide/docs/create_workgroup)

#### Arguments

[](#arguments-44)

ArgumentRequiredTypeDescription$domainYESstringThe domain under which you want to create the workgroup.$workgroupYESstringThe name of the new workgroup.### deleteWorkgroup

[](#deleteworkgroup)

```
$output = $opensrs->deleteWorkgroup(...);
```

#### Manual

[](#manual-46)

[https://email.opensrs.guide/docs/delete\_workgroup](https://email.opensrs.guide/docs/delete_workgroup)

#### Arguments

[](#arguments-45)

ArgumentRequiredTypeDescription$domainYESstringThe domain under which you want to create the workgroup.$workgroupYESstringThe name of the new workgroup.### searchWorkgroups

[](#searchworkgroups)

```
$output = $opensrs->searchWorkgroups(...);
```

#### Manual

[](#manual-47)

[https://email.opensrs.guide/docs/search\_workgroups](https://email.opensrs.guide/docs/search_workgroups)

#### Arguments

[](#arguments-46)

ArgumentRequiredTypeDescription$criteriaNOarray|objectNarrows the results.$sortNOarray|objectHow to sort display results$rangeFirstNOintSpecify the first workgroup to return$rangeLimitNOintSpecify the maximum number of results to return.---

Authentication Methods
----------------------

[](#authentication-methods)

### authenticate

[](#authenticate)

```
$output = $opensrs->authenticate(...);
```

#### Manual

[](#manual-48)

#### Arguments

[](#arguments-47)

ArgumentRequiredTypeDescription$tokenNOstringSpecify the token that you want to use.$fetchExtraInfoNOboolReturns additional information about the user.$generateSessionTokenNOboolReturns a session token.$sessionTokenDurationNOintSpecify how long session token lasts in seconds.### echo

[](#echo)

```
$output = $opensrs->echo(...);
```

#### Manual

[](#manual-49)

#### Arguments

[](#arguments-48)

ArgumentRequiredTypeDescription$dataYESarray|objectPayload to echo back.---

Migration Methods
-----------------

[](#migration-methods)

### migrationAdd

[](#migrationadd)

```
$output = $opensrs->migrationAdd(...);
```

#### Manual

[](#manual-50)

[https://email.opensrs.guide/docs/migration\_add](https://email.opensrs.guide/docs/migration_add)

#### Arguments

[](#arguments-49)

ArgumentRequiredTypeDescription$usersYESarray|objectDefines the source and destination of the email to migrate.$jobNOstring|intA job ID.### migrationJobs

[](#migrationjobs)

```
$output = $opensrs->migrationJobs(...);
```

#### Manual

[](#manual-51)

#### Arguments

[](#arguments-50)

No arguments

### migrationStatus

[](#migrationstatus)

```
$output = $opensrs->migrationStatus(...);
```

#### Manual

[](#manual-52)

[https://email.opensrs.guide/docs/migration\_status](https://email.opensrs.guide/docs/migration_status)

#### Arguments

[](#arguments-51)

ArgumentRequiredTypeDescription$idYESstring|intThe ID of the job you are querying.### migrationTrace

[](#migrationtrace)

```
$output = $opensrs->migrationTrace(...);
```

#### Manual

[](#manual-53)

[https://email.opensrs.guide/docs/migration\_trace](https://email.opensrs.guide/docs/migration_trace)

#### Arguments

[](#arguments-52)

ArgumentRequiredTypeDescription$jobYESstring|intThe ID of the job you are querying.$userYESstringThe username of the migration job.

###  Health Score

40

—

FairBetter than 86% of packages

Maintenance83

Actively maintained with recent releases

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~43 days

Total

9

Last Release

85d ago

Major Versions

1.5 → v2.0.02026-04-10

### Community

Maintainers

![](https://www.gravatar.com/avatar/e97ac0aa452b872ddc3f7f4c56c83852574a27bb74622f8c054d11ca20008fc9?d=identicon)[Ocolin](/maintainers/Ocolin)

---

Top Contributors

[![ocolin](https://avatars.githubusercontent.com/u/8870196?v=4)](https://github.com/ocolin "ocolin (2 commits)")

---

Tags

apiclientrestmailemailprovisioningopensrshostedemail

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/ocolin-open-srs-mail/health.svg)

```
[![Health](https://phpackages.com/badges/ocolin-open-srs-mail/health.svg)](https://phpackages.com/packages/ocolin-open-srs-mail)
```

###  Alternatives

[xeroapi/xero-php-oauth2

Xero official PHP SDK for oAuth2 generated with OpenAPI spec 3

1054.7M18](/packages/xeroapi-xero-php-oauth2)[onesignal/onesignal-php-api

A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com

34216.9k2](/packages/onesignal-onesignal-php-api)[meteocontrol/vcom-api-client

HTTP Client for meteocontrol's VCOM API - The VCOM API enables you to directly access your data on the meteocontrol platform.

188.0k1](/packages/meteocontrol-vcom-api-client)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

273.0k](/packages/eslazarev-wildberries-sdk)[openapi/openapi-sdk

Minimal and agnostic PHP SDK for Openapi® (https://openapi.com)

171.5k1](/packages/openapi-openapi-sdk)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
