PHP code example of spiralover / mailer-client
1. Go to this page and download the library: Download spiralover/mailer-client 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/ */
spiralover / mailer-client example snippets
use SpiralOver\Mailer\Client\Application;
entication-token>');
// List
$applications = $client->list();
// Create
$created = $client->create(
name: 'My Application 1',
url: 'localhost:7788',
webhook: 'localhost:7788/webhook',
desc: 'Hello World',
);
// Update
$updated = $client->update(
id: $created->application_id,
name: 'My Application 1',
url: 'localhost:7788',
webhook: 'localhost:7788/webhook',
desc: 'Hello World',
);
// Fetch Info
$viewed = $application->read('2eb91dc3-b8ad-4d41-a207-963cec055fac');
// Delete
$message = $application->delete($created->neuron_id);
use GuzzleHttp\Exception\GuzzleException;
use SpiralOver\Mailer\Client\Dto\Mailbox;
use SpiralOver\Mailer\Client\Dto\MailData;
use SpiralOver\Mailer\Client\Exceptions\RequestFailureException;
use SpiralOver\Mailer\Client\Mailer;
'Hello World',
from: Mailbox::create(
name: 'SpiralOver',
email: '[email protected] '
),
receiver: [
Mailbox::create(
name: 'Jane Doe',
email: '[email protected] '
)
]
)
]
);
MailData::create(
[...],
cc: [
Mailbox::create(
name: 'Jane',
email: '[email protected] '
)
],
bcc: [
Mailbox::create(
name: 'Shaheed',
email: '[email protected] '
)
],
reply_to: [
Mailbox::create(
name: 'Tom Tucker',
email: '[email protected] '
)
]
);
use SpiralOver\Mailer\Client\Application;
<authentication-token>',
server: Application::SERVER_SPIRALOVER,
apiVersion: 'v1'
);