Integration Examples

Welcome to our comprehensive collection of integration examples. We support multiple programming languages and frameworks, each with different implementation approaches to suit your specific needs.

Quick Navigation

JavaScript/TypeScript Ecosystem

PHP Ecosystem

Other Languages

Implementation Approaches

We offer two main approaches across all languages:

1. Official Libraries

  • Type-safe interfaces
  • Automatic error handling
  • Built-in retry mechanisms
  • Request validation
  • Simplified file attachment handling
  • Regular updates and improvements

2. Raw Implementations

  • Zero additional dependencies
  • Complete control over requests
  • Minimal footprint
  • Direct API interaction
  • Maximum flexibility
  • Native language features

Choosing the Right Implementation

Consider these factors when selecting your implementation approach:

Use Official Libraries When You Need:

  • Rapid integration
  • Built-in error handling
  • Automatic request validation
  • Simple file attachment handling
  • Type safety (in supported languages)
  • Regular updates and maintenance

Use Raw Implementations When You Need:

  • Minimal dependencies
  • Complete control over requests
  • Lightweight implementation
  • Custom error handling
  • Specific requirements not covered by libraries
  • Direct API interaction

Framework-Specific Integrations

We offer specialized integrations for popular frameworks:

Next.js

  • Server-side and client-side components support
  • Built-in API routes
  • Environment variable handling
  • Server Actions support
  • TypeScript integration

Laravel

  • Service container integration
  • Queue system support
  • Configuration system integration
  • Rate limiting
  • Facade support
  • Storage integration

Common Features Across All Implementations

All implementations support these core features:

  • Email sending with HTML and text content
  • File attachments
  • Custom headers
  • Recipient management
  • Error handling
  • Response parsing
  • Authentication

Getting Started

  1. Choose your preferred language from the navigation above
  2. Review the overview page for your chosen language
  3. Select either the library or raw implementation based on your needs
  4. Follow the implementation guide
  5. Test your integration using the provided examples

Each implementation guide includes:

  • Step-by-step setup instructions
  • Code examples
  • Best practices
  • Error handling guidance
  • Common use cases
  • Troubleshooting tips

Example Comparison

Here’s a simple “Hello World” example across different implementations:

// JavaScript Library
const shoutbox = new Shoutbox();
await shoutbox.sendEmail({
  from: "[email protected]",
  to: "[email protected]",
  subject: "Hello World",
  html: "<h1>Welcome!</h1>"
});

// PHP Library
$shoutbox = new Shoutbox();
$options = new EmailOptions();
$options->from = "[email protected]";
$options->to = "[email protected]";
$options->subject = "Hello World";
$options->html = "<h1>Welcome!</h1>";
$shoutbox->sendEmail($options);

// Python
from shoutbox import Shoutbox
shoutbox = Shoutbox()
shoutbox.send_email(
    from_="[email protected]",
    to="[email protected]",
    subject="Hello World",
    html="<h1>Welcome!</h1>"
)

Choose the implementation that best matches your project’s requirements and development style. All approaches are fully supported and maintained, ensuring you can build reliable email functionality into your application.