Skip to content

email all participants markdown to html broken #930

Closed

Description

@lbeziaud

Hi,

The formatting of emails sent through the "email all participants" functionality is broken. HTML tags are escaped. For example, sending:

**bold** [link](https://codabench.org)

results in:

--===============0869688155652953062==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit

<p>&lt;strong&gt;bold&lt;/strong&gt; &lt;a href="https://codabench.org"&gt;link&lt;/a&gt;</p>

--===============0869688155652953062==
Content-Type: text/html; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit

<p>&lt;strong&gt;bold&lt;/strong&gt; &lt;a href="https://codabench.org"&gt;link&lt;/a&gt;</p>
--===============0869688155652953062==--

which renders as:

<strong>bold</strong> <a href="https://codabench.org">link</a>

rather than

bold link

Activity

  1. ihsaan-ullah commented on Jun 11, 2023

    @ihsaan-ullah
    Collaborator

    This is written text in editor:
    Screenshot 2023-06-12 at 1 54 18 AM

    This is sent email
    Screenshot 2023-06-12 at 1 53 21 AM

  2. Didayolo commented on Jun 12, 2023

    @Didayolo
    Member

    Thank you for reporting this issue. Is it related to this change or is it a separate part of the code?

  3. ihsaan-ullah commented on Jun 13, 2023

    @ihsaan-ullah
    Collaborator

    Thank you for reporting this issue. Is it related to this change or is it a separate part of the code?

    This seems to be a separate issue. It looks like it is never tested with HTML
    This function receives raw html and while sending, the html is not properly parsed (needs investigation)
    https://github.com/codalab/codabench/blob/e7de84f703a5a56636800f0545be538795560194/src/utils/email.py#LL42C5-L42C32

    How can this be tested locally?

  4. Didayolo commented on Jun 13, 2023

    @Didayolo
    Member

    How can this be tested locally?

    Maybe you can try "to send an email to participants" locally and then find the raw body of the email inside the Django logs using docker-compose logs django. This is what I do read the activation email to create an account locally.


    That may not help with knowing if the formatting is good in the mailbox. We could use the staging server (codabench-test) for this development.

  5. lbeziaud commented on Oct 2, 2023

    @lbeziaud
    ContributorAuthor
  6. ihsaan-ullah commented on Feb 23, 2024

    @ihsaan-ullah
    Collaborator

    Solved by #1340

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions