Shipped
HomeContacts
  • Get started
  • 📚Tutorials
    • Make a waiting list
    • Launch a pre-sale
    • Build a SaaS
    • Create your store on Lemon Squeezy
  • 🟩Features
    • AI Services
    • Affiliate Program
    • Analytics
    • Authentication
      • MailChimp
      • Loops
      • AWS SES
      • SendGrid
      • Supabase Auth
        • Supabase Authentication Flow
        • Supabase Magic Link
        • Supabase Email & Password
        • Supabase Login with Google
    • API endpoints
      • 🛡️Authenticated API
    • Blog
    • Customer support
    • Chrome Extension
    • Dark mode
    • Database
      • Update your database
      • MongoDB
    • Emails
    • Error pages
    • Icons
    • Onboarding
    • Payments
      • Lemon Squeezy
        • Subscriptions
        • One-time purchase
        • Test mode
      • Stripe
    • Private pages
    • SEO
    • shadcn/ui
    • Supabase
    • Workspace / Organizations
  • 📦Components
    • AccountMenu
    • CtaBox
    • DarkModeSwitch
    • Explainer video
    • FAQ
    • Features
    • Footer
    • Header
    • Hero
    • Lifetime
    • Pricing
    • Sales Notification
    • Secondary Sidebar Pages
    • Sidebar
    • Tabs
    • Testimonials
    • Waitlist
    • WebAppPage
  • 🚀Deployment
  • ✅Other
    • Configuration
    • Changelog widget
    • Favicon
    • Google Fonts
    • Sitemap
    • Theme
  • Updates
  • GitHub Repository
  • Support
Powered by GitBook
On this page
  • Configure Auth to use Loops for Magic Link
  • Create a Transactional in Loops

Was this helpful?

  1. Features
  2. Authentication

Loops

Use Loops to send the Magic Link email

PreviousMailChimpNextAWS SES

Last updated 1 year ago

Was this helpful?

First of all, configure Loops.

For this to work you only need the LOOPS_API_KEY environment variable configured.

to set it.

Configure Auth to use Loops for Magic Link

Open src/config/auth.ts and set

import { emailFrom } from "@/config";
import { sendTransactionalEmail } from "@/libs/loops"

/* ... */

providers: [
  EmailProvider({
    async sendVerificationRequest({ identifier: email, url }) {
      await sendTransactionalEmail({
        transactionalId: "", // the transactional id you created on Loops
        email,
        dataVariables: {
          url, // change it to the variable you set in the Loops transactional
        },
      });
    },
  }),
],

Create a Transactional in Loops

Click "New" and create an email similar to this one:

It is important that url is a data variable.

Now click on "Next", copy the transactional id (a string with this format clq6w35vr000yib0qwz0bwxp7), and paste it in auth.ts as the value of transactionalId. You have now configured Loops to send the magic link email 🎉

Log in to Loops and go to .

🟩
Transactional
Using Loops to send Magic Link emails — Video tutorial
Follow this guide
Magic Link Email Transactional