📮
Mailwind
  • 🚀Getting started
    • 👋Introduction
    • 🔗Add a provider
  • 📚Documentation
    • 🎨Tailwind configuration
    • 🔡Dynamic Expressions
    • 📱Responsive
  • API parameters
  • Sendgrid
    • Send an email
      • cURL
      • .NET
      • NodeJS
      • PHP
  • AWS SES
    • Obtain your credentials
    • Send an email
      • cURL
      • .NET
      • NodeJS
      • PHP
  • Resend
    • Send an email
      • cURL
      • .NET
      • NodeJS
      • PHP
Powered by GitBook
On this page
  1. Resend
  2. Send an email

PHP

PreviousNodeJS

Last updated 1 year ago

To make the HTTP request easier, we use for the example. Be free to use whatever you want

Find all parameters via this link:

<?php
require 'vendor/autoload.php';

use GuzzleHttp\Client;

$client = new Client();
$url = "https://api.mailwind.io/v1/send/resend";

$data = [
    'layoutIdentifier' => '<<YOUR_LAYOUT_ID>>',
    'variables' => [],
    'code' => null,
    'from' => 'Example <example@mailwind.io>',
    'to' => 'example@mailwind.io',
    'subject' => 'hello world'
];

$headers = [
    "Content-Type" => "application/json",
    "Authorization" => "Bearer <<YOUR_API_KEY_HERE>>"
];

try {
    $response = $client->post($url, [
        'headers' => $headers,
        'json' => $data
    ]);

    $responseBody = $response->getBody();
    $decodedResponse = json_decode($responseBody, true);

    print_r($decodedResponse);
} catch (Exception $e) {
    echo "Error: " . $e->getMessage();
}
?>
Guzzle
https://resend.com/docs/api-reference/emails/send-email#body-parameters