MM-56629 Render Markdown in batched email notifications (#26217)

* [MM-56629] rendered markdown in batched email (#26116)

* [MM-56629] added unit test for GenerateHyperlinkForChannels (#26116)

* [MM-56629] refactored code to remove duplicates, updated test (#26116)

* [MM-56629] updated landing url and cleared check-style (#26116)

* [MM-56629] added app-layesrs and mocks (#26116)

* [MM-56629] updated unit tests (#26116)

* [MM-56629] reverted changes of removing unused context parameter (#26116)

* [MM-56629] removed unused method generateHyperlinkForChannels (#26116)

* [MM-56629] fixed check-style error (#26116)

* [MM-56629] refactored (#26116)

---------

Co-authored-by: Sazzad Hossain <sazzad.hossain@marginedge.com>
Co-authored-by: Harrison Healey <harrisonmhealey@gmail.com>
Этот коммит содержится в:
sazzad hossain
2024-03-07 22:27:08 +06:00
коммит произвёл GitHub
родитель ab029105fd
Коммит bc887441d0
8 изменённых файлов: 122 добавлений и 65 удалений

Просмотреть файл

@@ -13,6 +13,8 @@ import (
model "github.com/mattermost/mattermost/server/public/model"
store "github.com/mattermost/mattermost/server/v8/channels/store"
templates "github.com/mattermost/mattermost/server/v8/platform/shared/templates"
throttled "github.com/throttled/throttled"
@@ -65,13 +67,37 @@ func (_m *ServiceInterface) CreateVerifyEmailToken(userID string, newEmail strin
return r0, r1
}
// GetMessageForNotification provides a mock function with given fields: post, translateFunc
func (_m *ServiceInterface) GetMessageForNotification(post *model.Post, translateFunc i18n.TranslateFunc) string {
ret := _m.Called(post, translateFunc)
// GenerateHyperlinkForChannels provides a mock function with given fields: postMessage, teamName, teamURL
func (_m *ServiceInterface) GenerateHyperlinkForChannels(postMessage string, teamName string, teamURL string) (string, error) {
ret := _m.Called(postMessage, teamName, teamURL)
var r0 string
if rf, ok := ret.Get(0).(func(*model.Post, i18n.TranslateFunc) string); ok {
r0 = rf(post, translateFunc)
var r1 error
if rf, ok := ret.Get(0).(func(string, string, string) (string, error)); ok {
return rf(postMessage, teamName, teamURL)
}
if rf, ok := ret.Get(0).(func(string, string, string) string); ok {
r0 = rf(postMessage, teamName, teamURL)
} else {
r0 = ret.Get(0).(string)
}
if rf, ok := ret.Get(1).(func(string, string, string) error); ok {
r1 = rf(postMessage, teamName, teamURL)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// GetMessageForNotification provides a mock function with given fields: post, teamName, siteUrl, translateFunc
func (_m *ServiceInterface) GetMessageForNotification(post *model.Post, teamName string, siteUrl string, translateFunc i18n.TranslateFunc) string {
ret := _m.Called(post, teamName, siteUrl, translateFunc)
var r0 string
if rf, ok := ret.Get(0).(func(*model.Post, string, string, i18n.TranslateFunc) string); ok {
r0 = rf(post, teamName, siteUrl, translateFunc)
} else {
r0 = ret.Get(0).(string)
}
@@ -608,6 +634,11 @@ func (_m *ServiceInterface) SendWelcomeEmail(userID string, _a1 string, verified
return r0
}
// SetStore provides a mock function with given fields: st
func (_m *ServiceInterface) SetStore(st store.Store) {
_m.Called(st)
}
// Stop provides a mock function with given fields:
func (_m *ServiceInterface) Stop() {
_m.Called()