Download the PHP package ocolin/open-srs-mail without Composer

On this page you can find all versions of the php package ocolin/open-srs-mail. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package open-srs-mail

OpenSRS Email

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


Table Of Contents


Requirements


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 Names Arg Names Type Default Description
OPENSRS_MAIL_HOST $host string test server Name of OpenSRS server
OPENSRS_MAIL_USERNAME $username string N/A Username to log in as
OPENSRS_MAIL_PASSWORD $password string N/A Password for log in
OPENSRS_MAIL_MODE $mode string TOKEN Whether to use a password or token
OPENSRS_MAIL_TOKEN_EXPIRATION $token_expiration integer 10800 How long token will last. Up to 24 hours.
OPENSRS_MAIL_CACHE_PATH $cache_path string system temp files Where to store a temporary token.

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 value Server
TEST https://admin.test.hostedemail.com/api
A https://admin.a.hostedemail.com/api
B https://admin.b.hostedemail.com/api

Or 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

OpenSRS has two authentication methods.

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

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

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

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 constructor arguments

Configuration uses a Config class to store your settings.

Options

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


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

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.

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

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

changeUser

Manual

https://email.opensrs.guide/docs/change_user

Arguments

Argument Required Type Description
$user YES string The user that you want to create or modify.
$attributes YES object|arra The list of fields that you want to define or modify and their new values.
$createOnly NO boolean Used to prevent changes to existing accounts.

deleteUser

Manual

https://email.opensrs.guide/docs/delete_user

Arguments

Argument Required Type Description
$user YES string The user that you want to delete.

generateToken

Manual

https://email.opensrs.guide/docs/generate_token

Arguments

Argument Required Type Description
$user YES string The user's mailbox name.
$reason YES string The reason that the token was generated.
$duration NO int The number of hours for which the token is valid.
$oma NO bool If set to true, a session or sso type token may used with OMA
$token NO string The token to add.
$type NO string The type of token to generate.

getDeletedContacts

Manual

https://email.opensrs.guide/docs/get_deleted_contacts

Arguments

Argument Required Type Description
$user YES string The user's mailbox name.

getDeletedMessages

Manual

https://email.opensrs.guide/docs/get_deleted_messages

Arguments

Argument Required Type Description
$user YES string The user's mailbox name.
$headers NO array Specify the headers that you want returned.
$folder NO string Name of the folder to search.

getUser

Manual

https://email.opensrs.guide/docs/get_user

Arguments

Argument Required Type Description
$user YES string The user's mailbox name.

getUserAttributeHistory

Manual

https://email.opensrs.guide/docs/get_user_attribute_history

Arguments

Argument Required Type Description
$user YES string The user's mailbox name.
$attribute YES string The name of the attribute to query.

getUserChanges

Manual

https://email.opensrs.guide/docs/get_user_changes

Arguments

Argument Required Type Description
$user YES string The user's mailbox name.
$rangeFirst NO int The 0-based index of the first result to return.
$rangeLimit NO int The maximum number of results to return.

getUserFolders

Manual

https://email.opensrs.guide/docs/get_user_folders

Arguments

Argument Required Type Description
$user YES string The user's mailbox name.

getUserMessages

Manual

https://email.opensrs.guide/docs/get_user_messages

Arguments

Argument Required Type Description
$user YES string The user's mailbox name.
$folder NO string The folder to search for messages.
$limit NO int Specify the number of messages to return.
$recent NO bool Orders the results starting by most recent
$unseen NO bool Return a list of only those messages that have been delivered to the user.

logoutUser

Manual

https://email.opensrs.guide/docs/logout_user

Arguments

Argument Required Type Description
$user YES string The user's mailbox name.

moveUserMessages

Manual

https://email.opensrs.guide/docs/move_user_messages

Arguments

Argument Required Type Description
$user YES string The user's mailbox name.
$ids YES array The list of ids that you want to move.
$folder NO string The folder to search for messages.

reindex

Manual

https://email.opensrs.guide/docs/reindex

Arguments

Argument Required Type Description
$user YES string The user's mailbox name.
$ids YES array The list of ids that you want to move.
$folder NO string The folder to search for messages.

renameUser

Manual

https://email.opensrs.guide/docs/rename_user

Arguments

Argument Required Type Description
$user YES string The user's mailbox name.
$newName YES string The new name for the mailbox.

restoreDeletedContacts

Manual

https://email.opensrs.guide/docs/restore_deleted_contacts

Arguments

Argument Required Type Description
$user YES string The user's mailbox name.
$ids YES array The IDs for the messages that you want to restore.

restoreDeletedMessages

Manual

https://email.opensrs.guide/docs/restore_deleted_messages

Arguments

Argument Required Type Description
$user YES string The user's mailbox name.
$ids YES array The IDs for the messages that you want to restore.

restoreUser

Manual

https://email.opensrs.guide/docs/restore_user

Arguments

Argument Required Type Description
$user YES string The user's mailbox name.
$newName YES string Rename the restored account.
$id YES string A unique ID that identifies the user.

searchUsers

Manual

https://email.opensrs.guide/docs/search_users

Arguments

Argument Required Type Description
$criteria YES array Narrows the results
$fields NO array Additional fields to return.
$rangeFirst NO int Specify the first user to return.
$rangeLimit NO int Specify the maximum number of users to return.
$sort NO array etermines the way in which to sort results.

setRole

Manual

https://email.opensrs.guide/docs/set_role

Arguments

Argument Required Type Description
$user YES string The user to whom you are assigning a role.
$role YES string The name of the role.
$object YES array|string The object over which the user will have rights.

userNotify

Manual

https://email.opensrs.guide/docs/user_notify

Arguments

Argument Required Type Description
$user YES string The user's mailbox name.

userDisable2fa

Manual

https://email.opensrs.guide/docs/user_disable_2fa

Arguments

Argument Required Type Description
$user YES string The user's mailbox name.

appPassword

Manual

https://email.opensrs.guide/docs/app_password

Arguments

Argument Required Type Description
$user YES string The user's mailbox name.
$mode YES string A string, either "add" or "remove".
$tag NO string A string. for "add", the tag name desired for this new App Password.

resetEmailTest

Manual

https://email.opensrs.guide/docs/reset_email_test

Arguments

Argument Required Type Description
$testEmailRcpt YES string Email ID where test emails will be sent.
$brand YES string Brand id or brand name.
$company NO string Either a company id or company name.

getSieve

Manual

https://email.opensrs.guide/docs/get_sieve

Arguments

Argument Required Type Description
$user YES string The user's mailbox name.

setSieve

Manual

https://email.opensrs.guide/docs/set_sieve

Arguments

Argument Required Type Description
$user YES string The user's mailbox name.
$ruleset YES string Ruleset to set.
$data NO string Rule data
$activeRule NO string Set active rule

Stats Methods

statsList

Manual

https://email.opensrs.guide/docs/stats_list

No arguments.

statsSnapshot

Manual

https://email.opensrs.guide/docs/stats_snapshot

Arguments

Argument Required Type Description
$type YES string The type of entity for which you want to see statistics.
$object YES string The name of the company or domain.
$date YES string The date for which you want to see statistics.

statsSummary

Manual

https://email.opensrs.guide/docs/stats_summary

Arguments

Argument Required Type Description
$by NO string The interval that you want displayed in the response.
$type NO string The type of object.
$object NO string The name of the company, domain, or user to get statistics.

Domain methods

changeDomain

Manual

https://email.opensrs.guide/docs/change_domain

Arguments

Argument Required Type Description
$domain YES string The domain that you want to create or change.
$attributes YES array|object The list of fields to configure.
$createOnly NO bool Used to prevent changes to existing domains.

changeDomainBulletin

Manual

https://email.opensrs.guide/docs/change_domain_bulletin

Arguments

Argument Required Type Description
$domain YES string The domain name.
$bulletin YES string The name of the bulletin you want to create, edit, or delete.
$type YES string The bulletin delivery method.
$bulletinText NO string he text of the bulletin.

deleteDomain

Manual

https://email.opensrs.guide/docs/delete_domain

Arguments

Argument Required Type Description
$domain YES string The domain name.

getDomain

Manual

https://email.opensrs.guide/docs/get_domain

Arguments

Argument Required Type Description
$domain YES string The domain name.

getDomainBulletin

Manual

https://email.opensrs.guide/docs/get_domain_bulletin

Arguments

Argument Required Type Description
$domain YES string The domain name.
$bulletin YES string The name of the bulletin you want to view.
$type YES string The type of bulletin.

postDomainBulletin

Manual

https://email.opensrs.guide/docs/post_domain_bulletin

Arguments

Argument Required Type Description
$domain YES string The domain name.
$bulletin YES string The name of the bulletin you want to view.
$type YES string The bulletin type.
$testEmail NO string Send the bulletin to only the specified email.

restoreDomain

Manual

https://email.opensrs.guide/docs/restore_domain

Arguments

Argument Required Type Description
$domain YES string The domain name.
$newName YES string The new name for the domain.
$id YES string|int The domain id.

searchDomains

Manual

https://email.opensrs.guide/docs/search_domains

Arguments

Argument Required Type Description
$criteria NO array|object Narrows the results.
$sort NO array|object Sort the return display.
$rangeFirst NO int Specify the first domain to return
$rangeLimit NO int Specify the maximum number of results to return.

pushDomain

Manual

https://email.opensrs.guide/docs/push_domain

Arguments

Argument Required Type Description
$domain YES string The domain name.
$newCompany YES string company_id of the company that will receive the domain and mailboxes.

Company Methods

changeCompany

Manual

https://email.opensrs.guide/docs/change_company

Arguments

Argument Required Type Description
$company YES string The name of the company.
$attributes YES array|object A hash of company level attributes and values.

changeCompanyBulletin

Manual

https://email.opensrs.guide/docs/change_company_bulletin

Arguments

Argument Required Type Description
$company YES string The name of the company.
$bulletin YES string The name of the bulletin you want to create, change, or delete.
$type YES string Specify the bulletin type
$bulletinText NO string The bulletin is sent only when the post_company_bulletin method is run.

getCompany

Manual

https://email.opensrs.guide/docs/get_company

Arguments

Argument Required Type Description
$company YES string The name of the company.

getCompanyBulletin

Manual

https://email.opensrs.guide/docs/get_company_bulletin

Arguments

Argument Required Type Description
$company YES string The name of the company.
$bulletin YES string The name of the bulletin you want to view.
$type YES string Specify the bulletin type.

getCompanyChanges

Manual

https://email.opensrs.guide/docs/get_company_changes

Arguments

Argument Required Type Description
$company YES string The name of the company.
$rangeFirst NO int The 0-based index of the first result to return.
$rangeLimit NO int The maximum number of results to return.

postCompanyBulletin

Manual

https://email.opensrs.guide/docs/post_company_bulletin-1

Arguments

Argument Required Type Description
$company YES string The name of the company.
$bulletin YES string The name of the bulletin you want to view.
$type YES string Specify the bulletin type.
$testEmail NO string Sends the bulletin to only the specified email.

Brand Methods

searchBrands

Manual

https://email.opensrs.guide/docs/search_brands

Arguments

Argument Required Type Description
$criteria NO array|object Narrows the search for brands.
$rangeFirst NO int The 0-based index of the first result to return.
$rangeLimit NO int The maximum number of results to return.

searchBrandMembers

Manual

https://email.opensrs.guide/docs/search_brand_members

Arguments

Argument Required Type Description
$criteria NO array|object Narrows the search for brands.
$rangeFirst NO int The 0-based index of the first result to return.
$rangeLimit NO int The maximum number of results to return.

Workgroup Methods

createWorkgroup

Manual

https://email.opensrs.guide/docs/create_workgroup

Arguments

Argument Required Type Description
$domain YES string The domain under which you want to create the workgroup.
$workgroup YES string The name of the new workgroup.

deleteWorkgroup

Manual

https://email.opensrs.guide/docs/delete_workgroup

Arguments

Argument Required Type Description
$domain YES string The domain under which you want to create the workgroup.
$workgroup YES string The name of the new workgroup.

searchWorkgroups

Manual

https://email.opensrs.guide/docs/search_workgroups

Arguments

Argument Required Type Description
$criteria NO array|object Narrows the results.
$sort NO array|object How to sort display results
$rangeFirst NO int Specify the first workgroup to return
$rangeLimit NO int Specify the maximum number of results to return.

Authentication Methods

authenticate

Manual

https://email.opensrs.guide/docs/authenticate

Arguments

Argument Required Type Description
$token NO string Specify the token that you want to use.
$fetchExtraInfo NO bool Returns additional information about the user.
$generateSessionToken NO bool Returns a session token.
$sessionTokenDuration NO int Specify how long session token lasts in seconds.

echo

Manual

https://email.opensrs.guide/docs/echo

Arguments

Argument Required Type Description
$data YES array|object Payload to echo back.

Migration Methods

migrationAdd

Manual

https://email.opensrs.guide/docs/migration_add

Arguments

Argument Required Type Description
$users YES array|object Defines the source and destination of the email to migrate.
$job NO string|int A job ID.

migrationJobs

Manual

https://email.opensrs.guide/docs/testinput-1

Arguments

No arguments

migrationStatus

Manual

https://email.opensrs.guide/docs/migration_status

Arguments

Argument Required Type Description
$id YES string|int The ID of the job you are querying.

migrationTrace

Manual

https://email.opensrs.guide/docs/migration_trace

Arguments

Argument Required Type Description
$job YES string|int The ID of the job you are querying.
$user YES string The username of the migration job.

All versions of open-srs-mail with dependencies

PHP Build Version
Package Version
Requires guzzlehttp/guzzle Version ^7.10
php Version >=8.3
ocolin/global-type Version ^2.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package ocolin/open-srs-mail contains the following files

Loading the files please wait ...