PHP code example of leeovery / mailcoach-api
1. Go to this page and download the library: Download leeovery/mailcoach-api library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
leeovery / mailcoach-api example snippets
$apiPrefix = 'api';
$webPrefix = '';
Route::mailcoachApi($apiPrefix, $webPrefix);
grant_type:client_credentials
client_id:{your-client-id}
client_secret:{your-client-secret}
[
'email' => 'quired|array',
'list_ids.*' => ['tring',
]
[
'email' => 'sometimes|email:rfc,dns',
'unsubscribe_from_list_ids' => 'sometimes|array',
'unsubscribe_from_list_ids.*' => ['sometimes', 'integer', new Exists(EmailList::class, 'id')],
'resubscribe_to_list_ids' => 'sometimes|array',
'resubscribe_to_list_ids.*' => ['sometimes', 'integer', new Exists(EmailList::class, 'id')],
'attributes' => 'sometimes|nullable|array',
'attributes.*' => 'sometimes|nullable|string',
'unsubscribe_all' => 'sometimes|accepted|must_be_different:resubscribe_all',
'resubscribe_all' => 'sometimes|accepted|must_be_different:unsubscribe_all',
];
[
'name' => ['ired|string',
'content' => 'st::class, 'id')],
'from_email' => 'sometimes|email:rfc,dns',
'from_name' => 'sometimes|string',
'scheduled_at' => 'sometimes|nullable|date_format:Y-m-d H:i',
];
bash
php artisan vendor:publish --tag=mailcoach-api-migrations
bash
php artisan migrate
bash
php artisan vendor:publish --tag=mailcoach-api-views
bash
php artisan vendor:publish --tag=mailcoach-api-config
bash
php artisan passport:client --client