<?phprequire_once 'vendor/autoload.php';$lettermint = new Lettermint\Lettermint('your-api-key');
Send your first email:
Code
$response = $lettermint->email ->from('John Doe <john@yourdomain.com>') ->to('recipient@example.com') ->subject('Hello from Lettermint!') ->text('Hello! This is a test email.') ->send();echo "Email sent with ID: " . $response->id;
3. Email Features
Basic Email
Send a simple text or HTML email:
Code
$lettermint->email ->from('John Doe <john@yourdomain.com>') ->to('recipient@example.com') ->subject('Your account is ready!') ->html('<h1>Welcome!</h1><p>Thanks for signing up.</p>') ->text('Welcome! Thanks for signing up.') ->send();
One tag per message. Tags can contain letters, numbers, hyphens, underscores, and spaces (max 255 characters).
See Tags documentation for more details.
Route Selection
Direct emails to specific routes within your project:
Code
$lettermint->email ->from('notifications@yourdomain.com') ->to('user@example.com') ->subject('Welcome!') ->route('transactional') ->html('<p>Welcome to our platform.</p>') ->send();