Portal Community

Example 1: Order Confirmation Email (Plain Text)

Scenario: Send an immediate order confirmation to a customer after checkout with order details from workflow variables.

{
  "credential_id": "smtp-sendgrid-production",
  "to": "{{ vars.customer_email }}",
  "from_name": "{{ env.COMPANY_NAME }} Orders",
  "subject": "Order Confirmed — #{{ vars.order_number }}",
  "body": "Hi {{ vars.customer_first_name }},\n\nThank you for your order!\n\nOrder Number: {{ vars.order_number }}\nOrder Total: {{ vars.order_total }}\nEstimated Delivery: {{ vars.estimated_delivery_date }}\n\nWe will send you tracking information once your order ships.\n\nThank you for shopping with us.\n\nThe {{ env.COMPANY_NAME }} Team"
}
Expected outcome: Customer receives a personalised plain text confirmation within seconds of checkout completion. Message ID is logged to the audit trail variable.

Example 2: Invoice PDF Delivery with Attachment

Scenario: After a PDF invoice is generated and stored as a base64 string in vars.invoice_pdf_b64, email it to the customer and copy the accounts team.

{
  "credential_id": "smtp-ses-production",
  "to": "{{ vars.customer_email }}",
  "cc": "accounts@company.com",
  "from_name": "{{ env.COMPANY_NAME }} Finance",
  "subject": "Invoice #{{ vars.invoice_number }} — Due {{ vars.invoice_due_date }}",
  "body": "Please find attached your invoice #{{ vars.invoice_number }} for {{ vars.invoice_amount_formatted }}. Payment is due by {{ vars.invoice_due_date }}.",
  "html_body": "<p>Dear {{ vars.customer_name }},</p><p>Please find your invoice attached. Payment of <strong>{{ vars.invoice_amount_formatted }}</strong> is due by {{ vars.invoice_due_date }}.</p>",
  "attachments": [
    {
      "filename": "Invoice_{{ vars.invoice_number }}.pdf",
      "content_type": "application/pdf",
      "source": "workflow_variable",
      "data": "vars.invoice_pdf_b64"
    }
  ]
}
Expected outcome: Customer and accounts team receive the invoice PDF. The PDF attachment is decoded from base64 and attached natively — no external file storage required.

Example 3: SLA Breach Alert to Multiple Stakeholders

Scenario: A monitoring workflow detects that an SLA has been breached. Notify the on-call engineer, their manager, and the customer success lead simultaneously.

{
  "credential_id": "smtp-internal-relay",
  "to": [
    "{{ vars.oncall_engineer_email }}",
    "{{ vars.engineering_manager_email }}"
  ],
  "cc": "customer-success@company.com",
  "from_name": "BizFirst Monitoring",
  "subject": "URGENT: SLA Breach — {{ vars.service_name }} ({{ vars.breach_severity }})",
  "body": "SLA BREACH DETECTED\n\nService: {{ vars.service_name }}\nSeverity: {{ vars.breach_severity }}\nMetric: {{ vars.metric_name }}\nCurrent Value: {{ vars.current_value }}\nThreshold: {{ vars.threshold_value }}\nBreach Time: {{ vars.breach_detected_at }}\n\nImmediate investigation required.\nDashboard: {{ vars.dashboard_url }}",
  "reply_to": "alerts-noreply@company.com"
}
Expected outcome: All three recipients are alerted simultaneously. The email includes all diagnostic details needed to begin investigation immediately.

Example 4: Rich HTML Welcome Email with Liquid Template

Scenario: Send a branded HTML welcome email to a newly registered user, personalised with their name and account details.

{
  "credential_id": "smtp-mailgun-marketing",
  "to": "{{ vars.new_user_email }}",
  "from_name": "{{ env.COMPANY_NAME }} Team",
  "subject": "Welcome to {{ env.COMPANY_NAME }}, {{ vars.user_first_name }}!",
  "html_body": "<!DOCTYPE html><html><body style='font-family:sans-serif;max-width:600px;margin:auto;'><h1 style='color:#0f6cbd;'>Welcome, {{ user_first_name }}!</h1><p>Your account has been created successfully.</p><table><tr><td><strong>Email:</strong></td><td>{{ user_email }}</td></tr><tr><td><strong>Plan:</strong></td><td>{{ subscription_plan }}</td></tr></table><p><a href='{{ onboarding_url }}' style='background:#0f6cbd;color:white;padding:12px 24px;border-radius:6px;text-decoration:none;'>Start Onboarding</a></p></body></html>",
  "body": "Welcome {{ vars.user_first_name }}! Your {{ env.COMPANY_NAME }} account is ready. Log in at: {{ vars.onboarding_url }}"
}
Expected outcome: User receives a branded HTML email with their personalised details and an onboarding CTA button. Email clients without HTML support see the plain text fallback.

Example 5: Approval Notification with Deep Link

Scenario: Notify a department manager that a purchase request is pending their approval, including a direct approval link.

{
  "credential_id": "smtp-ses-production",
  "to": "{{ vars.approver_email }}",
  "bcc": "procurement-audit@company.com",
  "from_name": "BizFirst Approvals",
  "subject": "Action Required: Purchase Request #{{ vars.pr_number }} — {{ vars.pr_amount_formatted }}",
  "body": "Hi {{ vars.approver_name }},\n\nA purchase request requires your approval.\n\nRequest #: {{ vars.pr_number }}\nRequested by: {{ vars.requester_name }}\nAmount: {{ vars.pr_amount_formatted }}\nVendor: {{ vars.vendor_name }}\nBusiness Justification: {{ vars.justification }}\n\nApprove or reject here: {{ vars.approval_url }}\n\nThis request expires in 48 hours.",
  "reply_to": "{{ vars.requester_email }}"
}
Expected outcome: Approver receives a detailed notification email with a direct deep link to the approval UI. Reply goes to the requester. BCC ensures procurement audit trail.