Email-in: create a topic from a link?


#1

As a new topic can be created by pasting a link, I tried sending a message with a link in the Subject.

I was expecting the same behavior as with pasting the link, but the created topic was named after the URL, without a link.

I can think of a bad use case where anonymous emails are authorized with staged users, and spammers would send their click-bait URLs straight in. Otherwise, I think it would be nice to benefit from the automation of pasting URL to create a topic from a link via email. What do you think?

Example

This email’s Subject is an URL. It should create a new topic with the title of the page at URL, and a onebox in the email’s body.

Notes

  • email-in is enabled
  • john@example.com is a existing user
  • OR the category accepts email from anonymous users (and creates a staged user)

Input

Headers

Delivered-To: discourse@example.com
From: john@example.com
Subject: https://splendid.example.com/
To: email-in@discourse.example.com

Body

I found this article particularly enlightening.
But what do they mean by 'splendid example'?

Expected Outcome

  • Discourse retrieves title: ‘A Splendid Example’ (from the <title>A Splendid Example</title>) at https://splendid.example.com/
  • A new topic is created with title ‘A Splendid Example’
  • Topic is linked to https://splendid.example.com/
  • The first post has a onebox to https://splendid.example.com/
  • The first post also has the email body.

Post 1

Archetype: Normal
Title: A Splendid Example
User: john (or system or whatever user is configured to take email-in)

Body

https://splendid.example.com/

I found this article particularly enlightening.
But what do they mean by 'splendid example'?

Pasted Link Topic Notification Email Does Not Show the Link
(Jeff Atwood) #2

This is an editor feature so it will not work with email-in. That is by design.


#3

Ah, I can live with that. Maybe figure out a way via the API and a Web hook, or a procmail recipe. Thanks!