Terje Tofteberg

demo-email

Public
Terje Tofteberg(@trt)1w ago
100
0
0
To:
Cc:
Bcc:
Subject:

No topics yet. Start the conversation.

Summary

User supplied summary for the mail

A simple demo showing how to create and send emails with Novem

Description

The below description is supplied in free-text by the user

How to Send Emails with Novem Platform

This demo shows how to create and send emails programmatically using the Novem platform.

Quick Start

1. Install Dependencies

pip install novem python-dotenv

2. Set Up Your Credentials

Create a .env file with your Novem API token:

NOVEM_USERNAME=your_username
NOVEM_TOKEN=your_api_token_here

Get your API token from: https://novem.no/settings/tokens

3. Create and Send This Email

from novem import Mail

# Create a mail object with a unique identifier
mail = Mail("demo-email")

# Set email properties
mail.subject = "Welcome to Novem Email Demo"

# Set content with Novem's template syntax
mail.content = """{{ paragraph font size: l }}
# Hello from Novem! 👋
{{ /paragraph }}

{{ paragraph }}
This is a simple demonstration of sending emails through the Novem platform. 

Novem makes it easy to:
- Create beautifully formatted emails with Markdown
- Embed visualizations directly in your emails
- Send automated reports and updates
{{ /paragraph }}

{{ paragraph }}
Here's an example of embedding a visualization in your email:
{{ /paragraph }}

{{ vis
  ref: /p/novem-logo-svg-tutorial
  width: 100%
  include caption: true
  include link: true
}}
{{ /vis }}

{{ paragraph font style: i }}
This email was created using the Novem platform. Check out the Python script to see how easy it is to send emails programmatically!
{{ /paragraph }}"""

# Set recipient
mail.to = "recipient@example.com"

# Send it!
mail.send()

Content Formatting

Use Novem's template tags for rich formatting:

# Paragraph styles
"{{ paragraph font size: l }}"  # Large text (l/m/s/xs)
"{{ paragraph font style: b }}" # Bold text
"{{ paragraph font style: i }}" # Italic text
"{{ /paragraph }}"              # Close paragraph

# Embed visualizations
"""{{ vis
  ref: /p/plot_name
  width: 100%
  include caption: true
  include link: true
}}
{{ /vis }}"""

Key Features

  • Markdown Support: Write emails using familiar Markdown syntax
  • Embed Visualizations: Include charts and plots directly in emails
  • Template Syntax: Use Novem's template tags for rich formatting
  • Simple API: Just a few lines of Python code to send professional emails

Full documentation: https://novem.io/docs