{% import "partials/macros.html" as ui %} {# The "where alerts go" choices, shared by setup step 3 and the Alerts page's add flow. Context: errors, form (previous answers), ntfy_topic, telegram {configured, bot}, providers, security_modes, webhook (offer "Your own app" too). Telegram and Discord come first, side by side in weight: they are what nearly everyone uses. The rest sit under "More options", folded unless one of them is the current answer. #} {% set E = errors or {} %} {# The BotFather token, checked with Telegram by "Check and save" (or by Continue in setup). #} {% macro token_field(E, F, label="Bot token") -%}
{% if E.telegram_token %}{{ ui.field_error(E, "telegram_token") }}{% else %}

We check it with Telegram, then keep it on this computer. Anyone with it can send messages as your bot, so keep it to yourself.

{% endif %}
{%- endmacro %} {% set F = form or {} %} {% macro choice(k, title, desc, icon_name, checked) -%}
{{ caller() }}
{%- endmacro %} {% call choice("telegram", "Telegram", "Each find as a chat message with its photo. You make your own free bot first, about 3 minutes.", "send", kind == "telegram") %}
{% if not telegram.configured %}

A Telegram bot is a free chat account that only sends you what you ask for. BotFather, Telegram's own tool, makes one for you:

  1. Open @BotFather in Telegram (it has a blue tick), or search for it, then tap Start.
  2. Send /newbot.
  3. When it asks for a name, type anything, like My Vinted alerts.
  4. When it asks for a username, type one that ends in bot, like mags_vinted_bot. If it's taken, add a few numbers.
  5. BotFather answers Done! Congratulations. Under Use this token to access the HTTP API is a long code: tap it once to copy it, then paste it here.
{{ token_field(E, F) }}
{% endif %}
{% if telegram.rejected %}
{{ ui.icon("circle-alert") }}

{{ telegram.rejected }}

{% endif %}

Your bot: {% if telegram.bot %}@{{ telegram.bot }}{% else %}{{ telegram.masked or "" }}{% endif %}{% if telegram.from_env %} (from VINTED_BOT_TELEGRAM_BOT_TOKEN){% endif %}

  1. Tap Connect my chat. We make a one-time code.
  2. The button opens your bot in Telegram with the code ready: press Start. In a group, send the code shown instead.
{{ ui.field_error(E, "telegram") }}
{% endcall %} {% call choice("discord", "Discord", "Each find as a card in a channel of your server, with photos and buttons.", "message-circle", kind == "discord") %}

You need to be allowed to manage the channel. On a friend's server that only works if they make you an admin; otherwise make your own server.

  1. Click the cog next to the channel name: Edit Channel.
  2. Open Integrations, then Webhooks, then New Webhook.
  3. Click Copy Webhook URL and paste it below.
{% if E.discord_url %}{{ ui.field_error(E, "discord_url") }}{% else %}

Starts with discord.com/api/webhooks/. Keep it to yourself: anyone with it can post in that channel.

{% endif %}
{% endcall %}
{{ ui.icon("chevron-right", "i-sm") }}More optionsPhone notification app, email{% if webhook %}, your own app{% endif %}
{% call choice("ntfy", "Phone notification app", "A plain notification from the free ntfy app. No account.", "smartphone", kind == "ntfy") %} {% set topic = F.ntfy_topic or ntfy_topic %} {# ntfy:// links subscribe the Android app in one tap. The iPhone app has no such link, so the name itself stays big enough to type, with Copy for people already on the phone. #} {% set ntfy_link = "ntfy://ntfy.sh/" ~ topic ~ "?display=vinted-bot" %}
  1. On your phone, install ntfy from the App Store or Google Play. It's free and doesn't ask for your name, email or number.
  2. In ntfy, tap + and add this name: {{ topic }} {{ ui.icon("smartphone", "i-sm") }}Open in ntfy (Android)

Android: scan this with your phone's camera and tap the link. ntfy opens with this name already added.
iPhone: type the name above into ntfy. It stays the same if you come back later.

{{ ui.field_error(E, "ntfy_topic") }} {% endcall %} {% call choice("apprise", "Email", "Alerts in your inbox. Needs an app password from your email provider.", "mail", kind == "apprise") %}
{{ ui.field_error(E, "email_address") }}
{{ ui.field_error(E, "email_provider") }}
{{ ui.field_error(E, "email_smtp") }}
{{ ui.field_error(E, "email_port") }}
{{ ui.field_error(E, "email_security") }}

Leave it empty to sign in with the email address.

Your provider's help pages list these, often under "SMTP" or "outgoing mail". A server on your own network that doesn't ask you to sign in needs no password.

{{ ui.field_error(E, "email_password") }}

Your provider makes one in its security settings (Gmail: Google Account, Security, App passwords). Your normal password usually won't work.

{{ ui.icon("chevron-right") }}Slack, Pushover, Matrix and more

For people who've set these up before. Every service's link format.

{{ ui.field_error(E, "config") }} {% endcall %} {% if webhook %}
{% endif %}
{{ ui.field_error(E, "kind") }}