Allow the contact url setting to be an email

We currently are leaving our contact url setting blank, so that the contact email setting is used, which shows our support email address unlinked on the about page. But because we’ve also set up our support email address to be received by one of the forum groups, the new version emails sent to the contact email address are rejected because they’re autogenerated!

If I were to change our contact email address and then put our support email address into the contact url setting, it links it to https://intfiction.org/support@intfiction.org, obviously not what we want!

I can make it produce the correct link by making the contact url setting be mailto:support@intfiction.org, but it both shows the mailto to the user and it linkifies it.

Can the contact url setting be change to support email addresses directly, leaving them unlinked like it would if it were displaying the contact email instead?

PR at https://github.com/discourse/discourse/pull/7382

3 Likes

Thanks for the PR. Misusing the contact_url to solve your particular problem doesn’t feel right to me.

Wouldn’t it be easier to whitelist the email address used for sending new version emails? You can use the auto_generated_whitelist site setting for that.

2 Likes

On the other hand, mailto:alice@example.com is a URL so I think we should ensure it works properly.

1 Like

It works, but it doesn’t look pretty since it includes the mailto: in the link text.

<a href="mailto:alice@example.com" target="_blank">mailto:alice@example.com</a>

@Dannii wanted an email address that can be entered as contact_url and isn’t a link. That’s feels kinda wrong to me.

4 Likes

It’s also useless if you don’t have a locally configured mail client, which is becoming increasingly common.

Oh, that’s weird then. I agree on that part - I think we should render it as:

<a href="mailto:alice@example.com" target="_blank">alice@example.com</a>

If we wanted to drastically overengineer things I might add support for markdown so you could do

markdown:alice@example.com

or

markdown:[Alice](mailto:alice@example.com)

Disagree - websites can ask to handle the mailto: scheme on your system:

image

2 Likes

That works perfectly, thank you!

I guess I should’ve thought to look for it. Discourse continues to surprise me with how much it just supports out of the box.

5 Likes

Hi there!
You were mentioning the possibility to have this for the contact url when it contains an email address:
<a href="mailto:alice@example.com" target="_blank">alice@example.com</a>

Is it something planned? RIght now I’m using mailto, but as @gerhard mentioned it, it’s not pretty :slight_smile:

Thank you!