Email Module

Learn about setting up the email module.

The email module allows you to compose and send email using specific providers. Pre-configured providers allow Stacklane to provide simpler configurations. Contact us if you require a provider not already listed below.

Basic Use

Once configured, the email module named "📧" is available to non-GET JavaScript endpoints.

There are two ways to send an email. There is no functional difference between them. In both cases the email will not be sent unless the endpoint completes without exception.


Construct the new Email instance, then build the email. Sending is implied.

import {Email} from '📧';

new Email()


Use the factory method to, build the email, and then send().

import {Email} from '📧';'')

Plain Text

For creating emails with longer plain text, use a Function Supplier combined with JavaScript template literals:

let BillingSetupEmailText = (name)=>{

return `Dear ${name},

Thanks for setting up billing!`;


export {BillingSetupEmailText};
import {Email} from '📧';
import {BillingSetupEmailText} from '📤';
import {account} from '🔗';
import * as Props from '🎨';



An email service provider must be configured with a username, password, and "from" address. For sites configured in the Stacklane Console, the UI will guide the setup of these required fields. For a test environment such as WebStorm, you'll need to configure these directly:

  • "from" — May either be a simple email address, or it may contain a display name using the RFC822 format: "Example & Co." <>
  • [PROVIDER_TYPE] — Should be replaced with one of the supported provider types listed below. For example the full key for Mailgun would be email:mailgun.


For a list of available providers see integrations. To configure a provider from a test environment make sure and use its type.