Skip to content

Resonia-Health/veilmail-unreal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VeilMail Unreal Engine SDK

Official Veil Mail plugin for Unreal Engine. Send transactional and marketing emails with automatic PII protection directly from your Unreal Engine project — from both C++ and Blueprints.

Veil Mail is the only email API with a first-class Unreal Engine plugin. Resend, SendGrid, Mailgun, and Postmark offer no official Unreal support — integrating them means hand-rolling HTTP calls in C++ and exposing them to Blueprint yourself. This plugin gives you a fully BlueprintCallable interface with typed responses, a built-in test email window in the editor, and project settings integration for API key management.

Common use cases in games: email verification, password reset, receipts and invoices, player re-engagement, live-ops announcements, tournament and clan notifications, and transactional flows from dedicated servers or standalone builds.

Other Veil Mail SDKs: Unity · TouchDesigner · Node.js · Python · Go · 11 more

Overview

The VeilMail Unreal Engine SDK provides a fully Blueprint-compatible interface to the Veil Mail API. It includes:

  • Runtime module (VeilMail): HTTP client, email sending, domain management, templates, campaigns, audiences, webhooks, and analytics.
  • Editor module (VeilMailEditor): A built-in test email window accessible from the Tools menu, and project settings integration for API key configuration.

All public methods are BlueprintCallable, making the SDK usable from both C++ and Blueprints without any additional setup.

Requirements

  • Unreal Engine 5.1 or later
  • Platforms: Win64, Mac, Linux

Installation

Clone into your project's Plugins directory

cd YourProject/Plugins
git clone https://github.com/resonia/veil-mail-unreal.git VeilMail

Or copy the packages/sdk-unreal directory from the Veil Mail monorepo into your project:

YourProject/
  Plugins/
    VeilMail/
      VeilMail.uplugin
      Source/
        VeilMail/
        VeilMailEditor/

After adding the plugin, regenerate your project files and rebuild.

Setup

1. Configure your API key

Open Edit > Project Settings > Plugins > VeilMail and enter:

Setting Description
API Key Your Veil Mail API key (veil_live_xxx or veil_test_xxx)
Base URL API endpoint (default: https://api.veilmail.xyz)
Timeout (seconds) HTTP request timeout (default: 30, range: 5-120)
Strip API Key in Shipping Builds When enabled, the API key is not included in packaged shipping builds (default: true)

2. Enable the plugin

If not automatically enabled, go to Edit > Plugins, search for "VeilMail", and enable it. Restart the editor.

Blueprint Usage

Creating a Client

Use Create VeilMail Client From Settings to create a client that reads from your project settings:

  1. Right-click in your Blueprint graph
  2. Search for "Create VeilMail Client From Settings"
  3. Store the return value in a variable

Alternatively, use Create VeilMail Client to pass an API key and base URL directly.

Sending an Email

  1. Drag from your VeilMail Client variable
  2. Search for Send Email
  3. Fill in the From, To, Subject, and Html pins
  4. Connect a Custom Event to the OnComplete delegate
  5. The delegate provides bSuccess (bool) and Response (FVeilMailResponse)

Reading the Response

The FVeilMailResponse struct contains:

Field Type Description
bSuccess bool Whether the request succeeded (HTTP 2xx)
StatusCode int32 HTTP status code
Body FString Raw response body
ErrorMessage FString Error message (on failure)
ErrorCode FString Machine-readable error code (on failure)

Available Blueprint Functions

Emails:

  • SendEmail - Send a transactional email
  • GetEmail - Retrieve a sent email by ID
  • ListEmails - List all sent emails

Templates:

  • ListTemplates - List all email templates
  • GetTemplate - Retrieve a template by ID

Domains:

  • ListDomains - List verified sending domains

Audiences:

  • ListAudiences - List contact audiences

Campaigns:

  • ListCampaigns - List email campaigns
  • SendCampaign - Trigger a campaign send

Webhooks:

  • ListWebhooks - List configured webhooks

Analytics:

  • GetAnalyticsOverview - Get email analytics overview

Advanced:

  • RawRequest - Make a custom API request with any HTTP method, path, and JSON body

C++ Usage

Add module dependency

In your module's .Build.cs file:

PublicDependencyModuleNames.Add("VeilMail");

Send an email from C++

#include "VeilMailClient.h"

void AMyActor::SendWelcomeEmail()
{
    UVeilMailClient* Client = UVeilMailClient::CreateFromSettings();
    Client->AddToRoot(); // prevent garbage collection during async request

    FOnVeilMailResponse Delegate;
    Delegate.BindLambda([Client](bool bSuccess, const FVeilMailResponse& Response)
    {
        if (bSuccess)
        {
            UE_LOG(LogTemp, Log, TEXT("Email sent! Status: %d"), Response.StatusCode);
        }
        else
        {
            UE_LOG(LogTemp, Error, TEXT("Failed to send email: %s"), *Response.ErrorMessage);
        }

        Client->RemoveFromRoot();
    });

    Client->SendEmail(
        TEXT("noreply@yourdomain.com"),
        TEXT("player@example.com"),
        TEXT("Welcome!"),
        TEXT("<h1>Welcome to our game!</h1>"),
        Delegate
    );
}

Make a raw API request

UVeilMailClient* Client = UVeilMailClient::CreateFromSettings();

FOnVeilMailResponse Delegate;
Delegate.BindLambda([](bool bSuccess, const FVeilMailResponse& Response)
{
    // Handle response
});

Client->RawRequest(
    EVeilMailHttpMethod::POST,
    TEXT("/emails/batch"),
    TEXT("{\"emails\": [...]}"),
    Delegate
);

Verify webhook signatures

#include "VeilMailWebhook.h"

bool bValid = UVeilMailWebhook::VerifySignature(
    PayloadString,
    SignatureHeader,
    WebhookSecret
);

Editor Tools

Send Test Email Window

Access from Tools > VeilMail: Send Test Email in the editor menu bar. This opens a window where you can send a test email using your configured API key without writing any code.

Security

See Docs/SECURITY.md for detailed security guidance.

Key points:

  • Never ship API keys in game client builds. Use the bStripKeyInShipping setting (enabled by default).
  • For shipped game clients, route email requests through your own backend server.
  • Editor and dedicated server usage is safe since players do not have access to those binaries.

License

MIT License. See LICENSE for details.

About

Official Unreal Engine plugin for Veil Mail — the only email API with a first-class Unreal plugin. Send transactional and marketing email from Unreal Engine with Blueprint + C++ support and automatic PII protection.

Topics

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors