Skip to content

Add "Invite to NostrMail" button that appends invite instructions when recipient has no pubkey #90

Description

@asherp

Summary

When composing an email to a recipient who is not on Nostr / has no discoverable public key, there's nothing nostr-mail can encrypt to — the email goes out as plain text and the recipient has no idea nostr-mail exists. We should add an "Invite to NostrMail" button on the Compose page that appends friendly invite instructions to the outgoing email, turning every plaintext send into an organic growth opportunity.

Motivation

  • nostr-mail's value comes from network effects: the more contacts on Nostr, the more encrypted communication is possible.
  • Right now there's no in-app path to onboard a non-Nostr recipient. The sender would have to explain nostr-mail manually.
  • An invite affordance directly addresses the project's stated goal of bringing encrypted email to "the average person" by bridging Nostr and email.

Proposed behavior

On the Compose page (tauri-app/frontend/js/email-service.js / compose UI):

  • Detect missing pubkey: when the selected/entered recipient has no associated Nostr public key (not a Nostr contact, and no key found via the social key registry / relays), surface an "Invite to NostrMail" button or inline prompt.
  • One-click invite: clicking it appends a short, configurable invite block to the email body (e.g. at the bottom, clearly delimited), explaining what nostr-mail is and how to get started, plus the sender's own npub so the recipient can add them as a contact and reply encrypted.
  • Toggle/preview: the user can see/edit the appended text before sending, and remove it if they change their mind.
  • No-op when not needed: if the recipient already has a pubkey (encryption is possible), the button is hidden or replaced by the normal encrypt flow.

Example invite block (template)

---
This message was sent with NostrMail — encrypted email built on Nostr.
<sender-name> would like to communicate with you securely.

Get started:
1. Download NostrMail: https://github.com/asherp/nostr-mail
2. Generate or import a Nostr keypair
3. Add this contact: <sender-npub>

Once you're set up, replies between you will be end-to-end encrypted.
---

Acceptance criteria

  • Compose detects when a recipient has no resolvable Nostr pubkey.
  • An "Invite to NostrMail" button/prompt appears in that case.
  • Clicking it appends an editable, clearly-delimited invite block (including the sender's npub and a link to get NostrMail) to the email body.
  • The user can preview, edit, and remove the invite text before sending.
  • The button is hidden / not applicable when the recipient already has a pubkey.
  • Invite template is reasonably worded and ideally configurable (e.g. in Settings → Advanced).

Open questions

  • Should the invite be auto-suggested for any no-pubkey recipient, or strictly opt-in via the button?
  • Should there be a Settings toggle to always append invites to plaintext emails?
  • Invite copy/branding and where the download/landing link should point.
  • Should we also offer a "matching DM"-style invite where applicable, consistent with the existing Send Matching DM feature?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    Status
    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions