Slack Notification - HTML identifiers visible

When inserting notes or comments from a DocType in a Slack Notification, the HMTL identifiers such as <.div> and <./div> also get pulled into the notification (added the points to make the identifiers visible).

Is there a way around this?

This is the reference I use to get the notes: {{ doc.notes }}

1 Like

We are also facing this issue,. We are currently using slack apps for getting notifications when issue doctypes are created. The description field which is of field type “Text-editor” in Issue is coming with html tags. For e.g. the field description in slack channel in one particular issue is as attachment

As we can see above html tags are being transmitted from erpnext to slack.

Tagging @surajshetty for support.

I think this is a bug. It happen to me too :slight_smile:

1 Like

Thanks @rahy . Any way we can temporarily overcome this until its fixed ?

@harsha,
Sorry… I don’t know.
I use Slack for internal (admin) notification so I don’t bother to look for a solution, at least for now.

1 Like

Cool. We also using internally, but just trying to decrease the effort on our team while reading notifications. Lets see if anyone else can suggest or someone could fix it up.

Slack doesn’t allow HTML formatting. Instead, you can use markdown formatting
You can find it in the documentation.

https://docs.erpnext.com/docs/user/manual/en/setting-up/notifications#22-message-format

In this case we are just passing the description in Jinja format as below. The formatting I believe is in built in Description field which is of type “text-editor” as I mentioned below and probably the issue. Below is code we are using in notification as per standard slack notification format. Should we pass on the doc.description field in a different way ?

Case Number : {{ doc.name }}
Created Date : {{ doc.opening_date }}

Details

  • Caller name : {{ doc.km_caller_name }}
  • Phone No : {{ doc.raised_by_phone }}
  • District : {{ doc.km_district_case }}
  • Mandal : {{ doc.km_mandal_case }}
  • Village : {{ doc.km_village_case }}
  • Subject : {{ doc.subject }}
  • Description : {{doc.description }}
  • Created by : {{ doc.raised_by }}

i have this issue when sending notifications via SMS as well. The received sms contains HTML tags, like

<p> You have a new message.</p>

Any workarounds?