Getting started overview

To begin sending emails with Loops, developers first need to establish an account and retrieve the necessary API credentials. The process involves signing up on the Loops website, navigating to the API settings within the dashboard to locate the API key, and then integrating this key into a client application using one of the available SDKs or by making direct HTTP requests. Loops provides SDKs for Node.js, Python, Go, Ruby, and PHP, simplifying the integration process for various development environments. The platform is designed to support both transactional and marketing email functionalities, making it suitable for a range of communication needs from user onboarding to campaign distribution.

This guide outlines the essential steps to get a basic email sending operation functional, covering account creation, API key retrieval, and executing a first request. Subsequent sections address common next steps and troubleshooting tips to ensure a smooth initial integration.

Quick Reference: Loops Getting Started Steps

Step What to Do Where
1. Create Account Sign up for a new Loops account. Loops Homepage
2. Get API Key Locate and copy your unique API key. Loops Dashboard > Settings > API
3. Install SDK (Optional) Install the Loops SDK for your preferred language. Loops API Reference (specific SDK installation guides)
4. Configure Sender Domain Add and verify your sending domain. Loops Dashboard > Settings > Domains
5. Send First Email Execute a basic email sending request using your API key. Your application code or Loops API Reference

Create an account and get keys

The initial step for integrating with Loops is to create an account. Loops offers a free tier that supports up to 2,000 contacts and 10,000 emails per month, which is suitable for initial testing and small-scale applications. To sign up, navigate to the Loops homepage and follow the registration process. This typically involves providing an email address, setting a password, and agreeing to the terms of service.

API Key Retrieval

Upon successful account creation and logging into the Loops dashboard, your API key can be found in the settings section. This key is crucial for authenticating all API requests you make to the Loops platform. Treat your API key as sensitive information, similar to a password, to prevent unauthorized access to your email sending capabilities.

  1. Log in to your Loops account.
  2. Navigate to the Settings section, typically found in the sidebar or user menu.
  3. Locate the API tab or section within the settings.
  4. Your unique API key will be displayed. Copy this key for use in your application.

Loops uses API keys for authentication, a common method for securing access to web services. For enhanced security, consider environment variables or secret management services to store your API key in production environments, rather than hardcoding it directly into your application's source code. The AWS Secrets Manager documentation provides general best practices for handling sensitive credentials.

Domain Setup and Verification

Before sending emails, you must configure and verify a sending domain. This step is essential for email deliverability and to prevent your emails from being flagged as spam. Loops requires you to add DNS records (typically CNAME, MX, or TXT records) to your domain's DNS settings to prove ownership and authorize Loops to send emails on your behalf.

  1. In the Loops dashboard, go to Settings > Domains.
  2. Click Add Domain and enter the domain you wish to send emails from (e.g., yourcompany.com).
  3. Loops will provide specific DNS records (e.g., DKIM, SPF, Tracking) that you need to add to your domain registrar's DNS settings.
  4. After adding the records, return to the Loops dashboard and click Verify Domain. Verification can take some time to propagate globally.

Proper DNS record configuration, including SPF and DKIM, is critical for email authentication and improving sender reputation, as outlined by email service providers and industry standards.

Your first request

Once you have your API key and a verified sending domain, you can proceed with sending your first email. Loops provides SDKs for several programming languages, simplifying the process. This example will use Node.js, as it is one of the primary language examples highlighted by Loops, but the general principles apply to other SDKs.

Node.js Example: Sending a Transactional Email

First, install the Loops Node.js SDK:

npm install loops-sdk

Next, use the SDK to send a basic transactional email. Ensure you replace YOUR_LOOPS_API_KEY, [email protected], and [email protected] with your actual credentials and email addresses.

const loops = require('loops-sdk');

const apiKey = 'YOUR_LOOPS_API_KEY'; // Replace with your actual Loops API Key
loops.setApiKey(apiKey);

async function sendFirstEmail() {
  try {
    const response = await loops.sendTransactional({
      transactionalId: 'welcome_email',
      to: '[email protected]',
      subject: 'Welcome to Our Service!',
      body: 'Hello from Loops! This is your first transactional email.',
      from: '[email protected]', // Must be from your verified domain
      data: { // Optional custom data
        userName: 'New User'
      }
    });
    console.log('Email sent successfully:', response);
  } catch (error) {
    console.error('Error sending email:', error.response ? error.response.data : error.message);
  }
}

sendFirstEmail();

This code snippet initializes the Loops SDK with your API key and then calls the sendTransactional method. The transactionalId parameter references a template you might have set up in the Loops dashboard, though a basic subject and body are sufficient for a first test. Ensure the from address matches a verified domain in your Loops account.

Python Example: Sending a Transactional Email

Install the Loops Python SDK:

pip install loops-python

Use the SDK to send an email:

from loops import Loops

api_key = "YOUR_LOOPS_API_KEY" # Replace with your actual Loops API Key
loops_client = Loops(api_key)

def send_first_email():
    try:
        response = loops_client.send_transactional(
            transactionalId="welcome_email",
            to="[email protected]",
            subject="Welcome to Our Service!",
            body="Hello from Loops! This is your first transactional email.",
            _from="[email protected]", # Must be from your verified domain
            data={
                "userName": "New User"
            }
        )
        print("Email sent successfully:", response)
    except Exception as e:
        print("Error sending email:", e)

send_first_email()

Common next steps

After successfully sending your first email, several common next steps can enhance your Loops integration:

  • Explore Email Templates: Utilize the Loops dashboard to create and manage email templates. Using templates allows for consistent branding and content, and simplifies dynamic content injection via API calls.
  • Implement Webhooks: Set up webhooks to receive real-time notifications about email events such as deliveries, opens, clicks, and bounces. This is crucial for tracking email performance and building responsive application logic. Refer to the Loops Webhooks documentation for details.
  • Manage Contacts and Audiences: Learn how to add, update, and segment contacts within Loops. This is particularly important for marketing email campaigns and targeted communication. The Loops Contacts API provides methods for programmatic management.
  • Set Up Email Automation: Loops offers automation features to create drip campaigns, onboarding sequences, and other automated workflows based on user actions or time-based triggers.
  • Monitor Analytics: Regularly review the analytics dashboard in Loops to monitor email deliverability rates, open rates, click-through rates, and other key metrics. This data helps optimize your email strategy.

Troubleshooting the first call

Encountering issues during the initial API call is common. Here are some troubleshooting tips for your first Loops integration:

  • Invalid API Key: Double-check that the API key you are using exactly matches the one in your Loops dashboard. Even minor typos can lead to authentication failures. Ensure no extra spaces or characters are included.
  • Unverified Sending Domain: If your email fails to send, verify that the from email address belongs to a domain that has been fully verified in your Loops account. Check the DNS records in your domain registrar for correct SPF, DKIM, and tracking CNAME entries, and confirm their propagation.
  • Incorrect transactionalId: If you are using a specific transactionalId, ensure that an email template with that exact ID exists and is active in your Loops dashboard. For a basic test, you can send an email without a transactionalId by providing a subject and body directly.
  • Network Issues: Ensure your development environment has an active internet connection and is not blocked by a firewall from accessing Loops API endpoints.
  • SDK Version Mismatch: If using an SDK, ensure you have the latest version installed. Outdated SDKs might contain bugs or lack support for newer API features. Consult the Loops documentation for recommended SDK versions.
  • API Error Messages: Pay close attention to the error messages returned by the Loops API. These messages often provide specific details about what went wrong (e.g., 'Invalid 'to' email address', 'Domain not verified').
  • Check Loops Status Page: Occasionally, service outages can occur. Check the Loops status page to see if there are any ongoing incidents affecting the API.
  • Review Loops Documentation: The Loops API reference contains detailed information on request formats, parameters, and error codes for various endpoints.