Newsletters

Connect the business's email service

newsletters_connect_service · Changes data · Markdown

Connects the business's own email service (Brevo, Amazon SES, Mailgun or any SMTP server), which every newsletter email goes out through.

Free

This tool costs nothing to call.

An example

Our newsletter should go out through our Brevo account from news@halversoncycle.example. The SMTP key is in the Brevo settings.

Your agent callsnewsletters_connect_serviceFree

The example business is Halverson Cycle & Repair, a bike shop with a repair workshop in Portland, Oregon. The reply is the one the tool really gives.

With these arguments
{
  "host": "smtp-relay.brevo.com",
  "port": 587,
  "username": "8a1b2c001@smtp-brevo.com",
  "from_email": "news@halversoncycle.example",
  "per_day": 300
}
What comes back
{
  "link": "https://conecto.chat/api/bots/connect/8vnC_hnSlFnZv3nUdylKeDxdMFrLWEYnDCkc8wPV074",
  "expires_in_minutes": 60,
  "tell_the_owner": "Open this link within the hour, sign in to Conecto and type the email service's SMTP password or key there. It goes to Conecto only; I never see it.",
  "from_a_terminal": "npx @conecto-chat/cli@latest run newsletters_connect_service -i '{\"host\": \"smtp-relay.brevo.com\", \"port\": 587, \"username\": \"8a1b2c001@smtp-brevo.com\", \"from_email\": \"news@halversoncycle.example\", \"per_day\": 300}' -s password",
  "from_a_terminal_with_curl": "printf %s 'SMTP password or key: '; read -rs v1; echo; curl -sS -H \"Authorization: Bearer $CONECTO_KEY\" --data-urlencode password@<(printf %s \"$v1\") https://conecto.chat/api/bots/connect/8vnC_hnSlFnZv3nUdylKeDxdMFrLWEYnDCkc8wPV074; unset v1",
  "next": "When the owner types it on the link, account.credential_added (account_events) says so, with what newsletters_connect_service answered."
}

Use it when

Before the first newsletter, or when the business moves to another email service or changes its password.

  • For a newsletter tool that keeps its own list, like Mailchimp or Kit, use connect_add.

What it does

Newsletters go out through the business's own email service, from an address on its own domain: any service that takes mail over SMTP, such as Brevo, Amazon SES, Mailgun, Postmark, SendGrid, Mailchimp Transactional or the web host. Give its SMTP server, login and the from address. Called without password, it answers with a link for the owner, who types the SMTP password or key on a Conecto page, so it never passes through the chat (from_a_terminal does the same from a terminal); account.credential_added says when it is connected. Conecto logs in to check them and keeps the password encrypted, never shown again. Calling it again replaces them, and issues waiting for the service go out on the next round. With test_to, a short email also goes out, which shows the service takes mail from that address. Free.

What comes back

Without password: link, a page where the owner or an admin, signed in, types the SMTP password or key, with expires_in_minutes, tell_the_owner, from_a_terminal (the CLI), from_a_terminal_with_curl and next. With password: service, the server, port, security, login, from address and daily limit (never the password), and next: what to do now. Every reply also carries cost_usd and balance_usd.

Inputs

NameTypeWhat it is
hostRequiredstringThe SMTP server, e.g. smtp-relay.brevo.com or email-smtp.eu-west-1.amazonaws.com. 3 to 255 characters.
portinteger587 (STARTTLS) or 465 (SSL/TLS). Port 25 is blocked on Conecto's servers. 1 to 65,535. Default: 587.
securitystringstarttls or ssl. Left out: ssl on port 465, starttls otherwise. One of: starttls,ssl.
usernameRequiredstringThe SMTP login (for Brevo the SMTP login, for SendGrid "apikey"). 1 to 254 characters.
passwordstringThe SMTP password or key (for Brevo an SMTP key, not the account password). Leave it out to get the link instead. 1 to 1,000 characters.
from_emailRequiredstringThe address issues come from, on a domain the service lets the business send from, e.g. news@halversoncycle.com. Up to 254 characters.
per_dayintegerThe service's own daily limit, if it has one (Brevo's free plan: 300). Issues then go out over several days. 1 to 10,000,000.
test_tostringAlso send a short test email to this address. Up to 254 characters.

The call

Over MCP, call newsletters_connect_service on https://api.conecto.chat/mcp/newsletters. Over REST:

Terminal
curl -X POST https://api.conecto.chat/v1/tools/newsletters_connect_service \
  -H "Authorization: Bearer $CONECTO_KEY" \
  -H "Content-Type: application/json" \
  -d '{"host":"smtp-relay.brevo.com","port":587,"username":"8a1b2c001@smtp-brevo.com","from_email":"news@halversoncycle.example","per_day":300}'

When it refuses

A refused call costs nothing and says what to do next.

CodeWhenWhat to do
sending_paused403The business's email is paused after bounces, complaints or emails refused as cold outreach.Tell the owner. Conecto reviews the pause before sending resumes.
invalid_input400Port 25, or an address that is not an email address.Use port 587 or 465, and fix the address the message names.
login_failed400The business's email service refused the login.Check the SMTP login and password (often an SMTP key, not the account password) and connect it again.
service_unreachable502The business's email service could not be reached.Check the SMTP server and port (587 or 465), then try again.
service_refused502The business's email service turned the email down, often a from address it does not allow.Allow the from address in the service, or connect it with one it allows.
service_busy503The business's email service asked to slow down.Try again in a few minutes.
refused422The business's email service will not take mail for an address.Use another address for that person.

Give this to your agent.

Set up Conecto from https://conecto.chat/SKILL.md