允许联系网址设置为电子邮件

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 UX: Allow the contact url setting to be an email by curiousdannii · Pull Request #7382 · discourse/discourse · GitHub

3 个赞

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 个赞

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

1 个赞

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 个赞

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 个赞

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 个赞

你好!
你之前提到,当联系 URL 包含电子邮件地址时,是否可以考虑使用以下格式:
<a href="mailto:alice@example.com" target="_blank">alice@example.com</a>

这是否有计划实现?目前我使用的是 mailto 链接,但正如 @gerhard 所说,这样看起来不太美观 :slight_smile:

谢谢!