Skip to content

Email

Greentic has two email messaging packs:

PackUse this when
messaging-emailYou want SMTP outbound email.
messaging-microsoft-emailYou want Microsoft Graph mail with delegated OAuth credentials.

Inbound email is normally handled through an event provider or a provider webhook, such as SendGrid Inbound Parse, Mailgun Routes, AWS SES, or Microsoft Graph subscriptions when supported by the installed pack.

  1. Configure SMTP answers

    answers.json
    {
    "setup_answers": {
    "messaging-email": {
    "host": "smtp.example.com",
    "port": 587,
    "username": "mailer@example.com",
    "password": "your-smtp-password",
    "from_address": "support@example.com",
    "tls_mode": "starttls"
    }
    }
    }
  2. Run setup

    Terminal window
    gtc setup --answers answers.json ./my-bundle

Microsoft Graph Setup (messaging-microsoft-email)

Section titled “Microsoft Graph Setup (messaging-microsoft-email)”
  1. Configure Graph answers

    answers.json
    {
    "setup_answers": {
    "messaging-microsoft-email": {
    "from_address": "support@example.com",
    "graph_tenant_id": "your-tenant-id",
    "ms_graph_client_id": "your-client-id",
    "ms_graph_client_secret": "your-client-secret",
    "ms_graph_refresh_token": "your-refresh-token"
    }
    }
    }
  2. Run setup

    Terminal window
    gtc setup --answers answers.json ./my-bundle
OptionRequiredDescription
hostYesSMTP server host name
portYesSMTP server port, commonly 587
usernameYesSMTP account username
passwordYesSMTP password or app password
from_addressYesDefault sender email address
tls_modeYesTLS mode, for example starttls
public_base_urlNoPublic URL for webhook callbacks when the installed pack uses them
OptionRequiredDescription
from_addressYesSender mailbox
graph_tenant_idYesMicrosoft Entra tenant id
ms_graph_client_idYesMicrosoft Graph OAuth client id
ms_graph_client_secretYesMicrosoft Graph OAuth client secret
ms_graph_refresh_tokenYesOAuth refresh token for delegated mail access
public_base_urlNoPublic URL for webhook callbacks when the installed pack uses them

Email network requirements depend on the installed email pack and the mail transport you choose.

PackDirectionProtocol and portPurpose
messaging-emailOutgoingSMTP over TCP 587 with STARTTLS, or TCP 465 with implicit TLSOutbound email sends through your SMTP provider
messaging-emailOutgoing, legacy environmentsSMTP over TCP 25Only when your SMTP provider and hosting environment still allow port 25
messaging-emailIncomingNone by defaultInbound email normally comes from a separate event provider or webhook-based mail service
messaging-microsoft-emailOutgoingHTTPS 443 to login.microsoftonline.comMicrosoft OAuth token exchange and refresh
messaging-microsoft-emailOutgoingHTTPS 443 to graph.microsoft.comMicrosoft Graph mail sends and mailbox operations
messaging-microsoft-emailIncoming, when Graph subscriptions are enabled by the installed packHTTPS 443 from Microsoft Graph to GreenticMail change notifications to the public callback URL

When you use webhook-based inbound email from another provider, expose the Greentic runtime through HTTPS on port 443 and configure that provider to call the declared ingress URL.

- id: send_email
type: reply
config:
to: "{{user_email}}"
subject: "Your Support Request"
message: "Thank you for contacting us. We'll get back to you shortly."
- id: send_html_email
type: reply
config:
to: "{{user_email}}"
subject: "Welcome!"
html: |
<html>
<body>
<h1>Welcome to Our Service!</h1>
<p>Thank you for signing up.</p>
<a href="https://example.com/start">Get Started</a>
</body>
</html>
- id: send_with_attachment
type: reply
config:
to: "{{user_email}}"
subject: "Your Report"
message: "Please find your report attached."
attachments:
- url: "https://example.com/report.pdf"
filename: "report.pdf"
- id: send_copy
type: reply
config:
to: "{{user_email}}"
cc: "manager@example.com"
bcc: "archive@example.com"
subject: "Support Update"
message: "Your ticket has been resolved."
flows/on_email.ygtc
name: handle_email
version: "1.0"
nodes:
- id: process
type: reply
config:
to: "{{from_address}}"
subject: "Re: {{subject}}"
message: "Thank you for your email. We've received your message."
triggers:
- type: email
target: process