lcidral / mail2easy-pro
Client library for interfacing with the Mail2EasyPRO API.
This package's canonical repository appears to be gone and the package has been frozen as a result.
Installs: 1 220
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: ^5.6 || ^7.0
- guzzlehttp/guzzle: ~6.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.7
- phpunit/phpunit: 6.4
This package is auto-updated.
Last update: 2020-07-21 10:56:12 UTC
README
Client library for interfacing with the Mail2EasyPRO API.
Note: This package is in development, use for your own risk. Needs improvements, refactory and rewrite Tests.
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist lcidral/mail2easy-pro "dev-master"
or add
"lcidral/mail2easy-pro": "dev-master"
to the require section of your composer.json
file.
Configuration
Export evironment variable with Mail2Easy User Credentials:
$ export MAIL2EASYPRO_CREDENTIALS='{"user":"your-mail2easypro-account@mailinator.com","password":"y0urp455w0rd","client_code":"999999"}'
To persist this, you need to add this line in the .bash_profile
file inside your home directory.
And run composer install.
Usage
Once the extension is installed, simply use it in your code by:
Get contact list Code
$contactList = Mail2EasyPRO::create(getenv("MAIL2EASYPRO_CREDENTIALS"), ContactList::class); $contactListCode = $contactList->getContactListCode("TESTS - Lista de Contatos - Email");
Add new Contact in Contact List
$contact = Mail2EasyPRO::create(getenv("MAIL2EASYPRO_CREDENTIALS"), Contact::class); $response = $contact->add($contactListCode, "php-mail2easy@mailinator.com", "Fulano XPTO", "Mail2EasyPRO-0000");
Update list of values, adding Tag
$contactListCode = 61; $contactCode = 4; $fieldLovCode = $this->contactListOfValues->getFieldLovCode($contactListCode, $contactCode, "Yout TAG Name in Contact List"); $response = $this->contact->update($contactListCode, $contactCode, null, null, [ "cmp4" => [ $fieldLovCode ] ]);