Skip to content

Send email: Using {event_link} as URL for link not properly formatted #5858

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
paulmenzel opened this issue Jul 18, 2023 · 4 comments · Fixed by #5860
Closed

Send email: Using {event_link} as URL for link not properly formatted #5858

paulmenzel opened this issue Jul 18, 2023 · 4 comments · Fixed by #5860

Comments

@paulmenzel
Copy link

Indico 3.2.2

Using Send email, in the email body using Ctrl +k to make Indico-Instanz a link to {event_link}, the link in the resulting email is not properly formatted:

Über die https://events.hifis.net/e/808 <<a href=>">Indico-Instanz kannst Du Dir die geplante Zeit anzeigen lassen.

From the email message source:

=C3=BCr die IT4Science-Days diesen September beim MDC in Berlin-Buch. =C3=
=9Cber die <a href=3D"&lt;a href=3D" title=3D"2. IT4Science-Days 2023">http=
s://events.hifis.net/e/808</a>"&gt;Indico-Instanz kannst Du Dir die geplant=
e Zeit anzeigen lassen. Sollte der Zeit nicht passen, gib uns bitte =C3=BCb=
@paulmenzel paulmenzel added the bug label Jul 18, 2023
@ThiefMaster
Copy link
Member

{event_link} is already a full link, not just the URL:

class EventLinkPlaceholder(Placeholder):
    name = 'event_link'
    description = _('Link to the event')

    @classmethod
    def render(cls, event, **kwargs):
        return Markup('<a href="{url}" title="{title}">{url}</a>').format(url=event.short_external_url,
                                                                          title=event.title)

We could add {event_url} as well, but I'm not sure if most users would understand how to use that in the WYSIWYG HTML editor...

@paulmenzel
Copy link
Author

Thank you again for an answer with the reference to the code. Awesome!

I guess, it’s a documentation problem then. I was wondering why it wasn’t named event_url. event_url would be useful for people wanting to use another text for the link.

@ThiefMaster
Copy link
Member

hmm i think in some other place (iirc in one of our custom plugins) we have {event_link:custom title here} (or something like that) which then generates the HTML link with a custom title. doing the same here wouldn't be too hard

@paulmenzel
Copy link
Author

Awesome. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants