Skip to main content

Email Action (Send E-Mail)

The Email Action enables sending emails via SMTP servers with customizable subjects and content.

What does this integration do?

The Email Action sends emails through configurable SMTP servers. It supports variable interpolation in all email fields and enables sending dynamic emails based on workflow data.

Typical Use Cases:

  • Notifications: Automatic notification of teams or customers
  • Reports: Sending automatically generated reports
  • Alerts: Immediate notification of critical events
  • Confirmations: Confirmation emails for orders or registrations
  • Follow-up: Automatic follow-up emails in sales processes
  • Status Updates: Regular project or system status updates

User Configuration

SMTP Server Configuration

SMTP Host

  • Purpose: Address of the email server
  • Format: Domain or IP address
  • Examples:
    • smtp.gmail.com (Gmail)
    • smtp.office365.com (Outlook/Office 365)
    • mail.company.com (Company server)
    • localhost (Local mail server)

SMTP Port

  • Purpose: Port of the email server
  • Standard Ports:
    • 587 - STARTTLS (recommended)
    • 465 - SSL/TLS
    • 25 - Unencrypted (not recommended)
  • Security: Port 465 is automatically detected as secure

SMTP Username

  • Purpose: Username for SMTP authentication
  • Format: Usually email address or username
  • Security: Stored encrypted
  • Examples: noreply@company.com, workflow.system@example.com

SMTP Password

  • Purpose: Password for SMTP authentication
  • Security: Stored encrypted
  • Note: Gmail/Outlook often require app-specific passwords

Email Configuration

From (Sender)

  • Purpose: Email address of the sender
  • Format: Valid email address
  • Variable Support: Yes, can come from workflow data
  • Examples:
    • noreply@company.com
    • {{senderEmail}} (from variable)
    • system@workflow.company.com

To (Recipient)

  • Purpose: Email address of the recipient
  • Format: Valid email address
  • Variable Support: Yes, often from workflow data
  • Examples:
    • customer@example.com
    • {{customerEmail}} (from variable)
    • team@company.com

Subject

  • Purpose: Email subject line
  • Variable Support: Yes, for dynamic subjects
  • Examples:
    • Your order #{{orderNumber}} has been shipped
    • Weekly report from {{reportDate}}
    • Alert: {{alertType}} detected

Content/Body

  • Purpose: Main content of the email
  • Format: Plain text
  • Variable Support: Yes, for dynamic content
  • Multi-line: Supported

How it Works

SMTP Connection

Transport Configuration:

  • Automatic SSL/TLS detection based on port
  • Secure authentication with encrypted credentials
  • Connection pooling for performance

Security:

  • Port 465: Automatically SSL enabled
  • Other ports: STARTTLS when available
  • Secure credential storage

Variable Processing

Template Engine:

  • All email fields support {{variableName}} syntax
  • Automatic substitution from workflow memory
  • Graceful handling of missing variables

Workflow Integration

Email Templates

Simple Notification:

From: noreply@company.com
To: {{customerEmail}}
Subject: Your order has been processed
Body:
Hello {{customerName}},

Your order #{{orderNumber}} has been successfully processed.

Shipping address: {{shippingAddress}}
Expected delivery: {{deliveryDate}}

Thank you for your trust!

Status Update:

From: system@company.com
To: team@company.com
Subject: {{systemName}} Status Update
Body:
{{systemName}} Status Report

Status: {{systemStatus}}
Uptime: {{uptime}}
Last Check: {{lastCheck}}

{{detailedMessage}}

Alert Notification:

From: alerts@company.com
To: {{alertRecipient}}
Subject: ALERT: {{alertType}} - {{severity}}
Body:
Alert detected at {{timestamp}}

Type: {{alertType}}
Severity: {{severity}}
System: {{systemName}}

Details:
{{alertDetails}}

Please investigate immediately.

Usage with Other Actions

Combined with LLM Action:

1. LLM Action generates email content
Output: emailContent

2. Email Action sends
Body: {{emailContent}}

Combined with HTTP Action:

1. HTTP Action retrieves customer data
Output: customerData

2. Email Action uses data
To: {{customerData.email}}
Body: Hello {{customerData.name}}, ...

Practical Examples

Order Confirmation

Configuration:

  • SMTP Host: smtp.company.com
  • SMTP Port: 587
  • SMTP Username: orders@company.com
  • SMTP Password: [secure_password]
  • From: orders@company.com
  • To: {{customerEmail}}
  • Subject: Order Confirmation #{{orderNumber}}
  • Body:
Hello {{customerName}},

Thank you for your order #{{orderNumber}}.

Order total: {{orderTotal}}€
Shipping address: {{shippingAddress}}

Your order will be processed shortly.

Team Alert

Configuration:

  • SMTP Host: smtp.gmail.com
  • SMTP Port: 587
  • From: alerts@company.com
  • To: devops@company.com
  • Subject: 🚨 System Alert: {{alertType}}
  • Body:
Alert Details:
- System: {{systemName}}
- Time: {{alertTime}}
- Severity: {{severity}}
- Message: {{alertMessage}}

Please check immediately: {{dashboardUrl}}

Weekly Report

Configuration:

  • From: reports@company.com
  • To: management@company.com
  • Subject: Weekly Report - {{weekStart}} to {{weekEnd}}
  • Body:
Weekly Summary:

Sales: {{weeklySales}}€
New Customers: {{newCustomers}}
Support Tickets: {{supportTickets}}

Detailed Report:
{{reportDetails}}

Password Reset

Configuration:

  • From: noreply@company.com
  • To: {{userEmail}}
  • Subject: Password Reset Request
  • Body:
Hello {{userName}},

You requested a password reset. Click the link below:
{{resetLink}}

This link expires in 24 hours.

If you didn't request this, please ignore this email.

Technical Details

Schema Configuration

configSchema: {
smtpHost: {
name: 'SMTP Host',
description: 'The SMTP server address',
schema: z.string(),
},
smtpPort: {
name: 'SMTP Port',
description: 'The SMTP server port',
schema: z.number(),
},
smtpUser: {
name: 'SMTP Username',
description: 'The username for the SMTP server',
schema: z.string(),
reference: 'secured',
},
smtpPass: {
name: 'SMTP Password',
description: 'The password for the SMTP server',
schema: z.string(),
reference: 'secured',
},
from: {
name: 'From',
description: 'The sender email address',
schema: z.string().email(),
parser: true,
},
to: {
name: 'To',
description: 'The recipient email address',
schema: z.string().email(),
parser: true,
},
subject: {
name: 'Subject',
description: 'The email subject',
schema: z.string(),
parser: true,
},
body: {
name: 'Content/Body',
parser: true,
schema: z.string(),
},
}

Internal Implementation

Nodemailer Integration:

  • Uses Nodemailer for robust email functionality
  • Automatic transport configuration based on settings
  • Built-in retry logic for temporary failures

Security Features:

  • Automatic SSL/TLS detection
  • Encrypted credential storage
  • Secure SMTP authentication

Logging:

  • Detailed logging of email sending
  • Message ID tracking for debugging
  • Error logging with complete details

Best Practices

SMTP Configuration

Server Selection:

  • Use reliable SMTP providers
  • Implement backup SMTP servers
  • Monitor server availability

Security:

  • Always use encrypted connections
  • Implement app-specific passwords
  • Rotate SMTP credentials regularly

Email Design

Subject Lines:

  • Keep subjects short and meaningful
  • Use consistent prefixes (e.g., [ALERT], [REPORT])
  • Avoid spam-suspicious terms

Content Design:

  • Structure emails clearly and readably
  • Use consistent formatting
  • Include relevant contact information

Performance

Rate Limiting:

  • Consider SMTP server limits
  • Implement delays for bulk emails
  • Monitor sending speeds

Variable Optimization:

  • Validate variables before email sending
  • Implement fallback values
  • Monitor template rendering performance

Compliance

GDPR/Privacy:

  • Implement opt-out mechanisms
  • Use privacy-compliant email addresses
  • Document email sending for audits

Deliverability:

  • Use SPF/DKIM/DMARC records
  • Monitor sender domain reputation
  • Implement bounce handling

The Email Action enables reliable, secure email communication as an integral part of automated workflows in Vectense Platform.