Skip to content

Email alerts - threading doesn't work with Gmail due to square brackets in subject line #1563

@jaydeethree

Description

@jaydeethree

Describe the bug

I've noticed some strange issues with threading of email alerts in Gmail. Specifically I see that different alerts get merged into a single email thread even though they have different subject lines. So for example I might have Alert X and Alert Y that both send emails - even though the subjects are different ([Alert X] Alert triggered vs. [Alert Y] Alert triggered) Gmail will merge those two emails into a single thread.

It looks like the reason for this is that Gmail ignores text in square brackets when creating threads, and since the alert name is in square brackets Gmail is just threading everything together since it's only matching on the "Alert triggered" text.

An easy fix would be to just remove the square brackets from the subject line here:

https://github.com/TwiN/gatus/blob/master/alerting/provider/email/email.go#L145-L151

However I realize that some people might prefer the square brackets, so another option could be to add a bool to the config that controls whether square brackets are used.

I have some Golang experience and I'd be happy to send a PR if you let me know how you'd like this to be implemented :)

Thanks so much for your work on this project!

What do you see?

No response

What do you expect to see?

No response

List the steps that must be taken to reproduce this issue

No response

Version

5.35.0

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/alertingRelated to alertingbugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions