mirror of
https://github.com/zitadel/zitadel.git
synced 2025-10-21 10:50:16 +00:00
feat: e-mail templates (#1158)
* View definition added * Get templates and texts from the database. * Fill in texts in templates * Fill in texts in templates * Client API added * Weekly backup * Weekly backup * Daily backup * Weekly backup * Tests added * Corrections from merge branch * Fixes from pull request review
This commit is contained in:
@@ -316,6 +316,46 @@ func (mr *MockAdminServiceClientMockRecorder) GetDefaultLoginPolicySecondFactors
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetDefaultLoginPolicySecondFactors", reflect.TypeOf((*MockAdminServiceClient)(nil).GetDefaultLoginPolicySecondFactors), varargs...)
|
||||
}
|
||||
|
||||
// GetDefaultMailTemplate mocks base method
|
||||
func (m *MockAdminServiceClient) GetDefaultMailTemplate(arg0 context.Context, arg1 *emptypb.Empty, arg2 ...grpc.CallOption) (*admin.DefaultMailTemplateView, error) {
|
||||
m.ctrl.T.Helper()
|
||||
varargs := []interface{}{arg0, arg1}
|
||||
for _, a := range arg2 {
|
||||
varargs = append(varargs, a)
|
||||
}
|
||||
ret := m.ctrl.Call(m, "GetDefaultMailTemplate", varargs...)
|
||||
ret0, _ := ret[0].(*admin.DefaultMailTemplateView)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
|
||||
// GetDefaultMailTemplate indicates an expected call of GetDefaultMailTemplate
|
||||
func (mr *MockAdminServiceClientMockRecorder) GetDefaultMailTemplate(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
varargs := append([]interface{}{arg0, arg1}, arg2...)
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetDefaultMailTemplate", reflect.TypeOf((*MockAdminServiceClient)(nil).GetDefaultMailTemplate), varargs...)
|
||||
}
|
||||
|
||||
// GetDefaultMailTexts mocks base method
|
||||
func (m *MockAdminServiceClient) GetDefaultMailTexts(arg0 context.Context, arg1 *emptypb.Empty, arg2 ...grpc.CallOption) (*admin.DefaultMailTextsView, error) {
|
||||
m.ctrl.T.Helper()
|
||||
varargs := []interface{}{arg0, arg1}
|
||||
for _, a := range arg2 {
|
||||
varargs = append(varargs, a)
|
||||
}
|
||||
ret := m.ctrl.Call(m, "GetDefaultMailTexts", varargs...)
|
||||
ret0, _ := ret[0].(*admin.DefaultMailTextsView)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
|
||||
// GetDefaultMailTexts indicates an expected call of GetDefaultMailTexts
|
||||
func (mr *MockAdminServiceClientMockRecorder) GetDefaultMailTexts(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
varargs := append([]interface{}{arg0, arg1}, arg2...)
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetDefaultMailTexts", reflect.TypeOf((*MockAdminServiceClient)(nil).GetDefaultMailTexts), varargs...)
|
||||
}
|
||||
|
||||
// GetDefaultOrgIamPolicy mocks base method
|
||||
func (m *MockAdminServiceClient) GetDefaultOrgIamPolicy(arg0 context.Context, arg1 *emptypb.Empty, arg2 ...grpc.CallOption) (*admin.OrgIamPolicyView, error) {
|
||||
m.ctrl.T.Helper()
|
||||
@@ -836,6 +876,46 @@ func (mr *MockAdminServiceClientMockRecorder) UpdateDefaultLoginPolicy(arg0, arg
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateDefaultLoginPolicy", reflect.TypeOf((*MockAdminServiceClient)(nil).UpdateDefaultLoginPolicy), varargs...)
|
||||
}
|
||||
|
||||
// UpdateDefaultMailTemplate mocks base method
|
||||
func (m *MockAdminServiceClient) UpdateDefaultMailTemplate(arg0 context.Context, arg1 *admin.DefaultMailTemplateUpdate, arg2 ...grpc.CallOption) (*admin.DefaultMailTemplate, error) {
|
||||
m.ctrl.T.Helper()
|
||||
varargs := []interface{}{arg0, arg1}
|
||||
for _, a := range arg2 {
|
||||
varargs = append(varargs, a)
|
||||
}
|
||||
ret := m.ctrl.Call(m, "UpdateDefaultMailTemplate", varargs...)
|
||||
ret0, _ := ret[0].(*admin.DefaultMailTemplate)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
|
||||
// UpdateDefaultMailTemplate indicates an expected call of UpdateDefaultMailTemplate
|
||||
func (mr *MockAdminServiceClientMockRecorder) UpdateDefaultMailTemplate(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
varargs := append([]interface{}{arg0, arg1}, arg2...)
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateDefaultMailTemplate", reflect.TypeOf((*MockAdminServiceClient)(nil).UpdateDefaultMailTemplate), varargs...)
|
||||
}
|
||||
|
||||
// UpdateDefaultMailText mocks base method
|
||||
func (m *MockAdminServiceClient) UpdateDefaultMailText(arg0 context.Context, arg1 *admin.DefaultMailTextUpdate, arg2 ...grpc.CallOption) (*admin.DefaultMailText, error) {
|
||||
m.ctrl.T.Helper()
|
||||
varargs := []interface{}{arg0, arg1}
|
||||
for _, a := range arg2 {
|
||||
varargs = append(varargs, a)
|
||||
}
|
||||
ret := m.ctrl.Call(m, "UpdateDefaultMailText", varargs...)
|
||||
ret0, _ := ret[0].(*admin.DefaultMailText)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
|
||||
// UpdateDefaultMailText indicates an expected call of UpdateDefaultMailText
|
||||
func (mr *MockAdminServiceClientMockRecorder) UpdateDefaultMailText(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
varargs := append([]interface{}{arg0, arg1}, arg2...)
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateDefaultMailText", reflect.TypeOf((*MockAdminServiceClient)(nil).UpdateDefaultMailText), varargs...)
|
||||
}
|
||||
|
||||
// UpdateDefaultOrgIamPolicy mocks base method
|
||||
func (m *MockAdminServiceClient) UpdateDefaultOrgIamPolicy(arg0 context.Context, arg1 *admin.OrgIamPolicyRequest, arg2 ...grpc.CallOption) (*admin.OrgIamPolicy, error) {
|
||||
m.ctrl.T.Helper()
|
||||
|
@@ -349,6 +349,48 @@ service AdminService {
|
||||
};
|
||||
}
|
||||
|
||||
rpc GetDefaultMailTemplate(google.protobuf.Empty) returns (DefaultMailTemplateView) {
|
||||
option (google.api.http) = {
|
||||
get: "/policies/mailtemplate"
|
||||
};
|
||||
|
||||
option (caos.zitadel.utils.v1.auth_option) = {
|
||||
permission: "iam.policy.read"
|
||||
};
|
||||
}
|
||||
|
||||
rpc UpdateDefaultMailTemplate(DefaultMailTemplateUpdate) returns (DefaultMailTemplate) {
|
||||
option (google.api.http) = {
|
||||
put: "/policies/mailtemplate"
|
||||
body: "*"
|
||||
};
|
||||
|
||||
option (caos.zitadel.utils.v1.auth_option) = {
|
||||
permission: "iam.policy.write"
|
||||
};
|
||||
}
|
||||
|
||||
rpc GetDefaultMailTexts(google.protobuf.Empty) returns (DefaultMailTextsView) {
|
||||
option (google.api.http) = {
|
||||
get: "/policies/mailtexts"
|
||||
};
|
||||
|
||||
option (caos.zitadel.utils.v1.auth_option) = {
|
||||
permission: "iam.policy.read"
|
||||
};
|
||||
}
|
||||
|
||||
rpc UpdateDefaultMailText(DefaultMailTextUpdate) returns (DefaultMailText) {
|
||||
option (google.api.http) = {
|
||||
put: "/policies/mailtext"
|
||||
body: "*"
|
||||
};
|
||||
|
||||
option (caos.zitadel.utils.v1.auth_option) = {
|
||||
permission: "iam.policy.write"
|
||||
};
|
||||
}
|
||||
|
||||
rpc GetDefaultLoginPolicy(google.protobuf.Empty) returns (DefaultLoginPolicyView) {
|
||||
option (google.api.http) = {
|
||||
get: "/policies/login"
|
||||
@@ -992,6 +1034,63 @@ message DefaultLabelPolicyView {
|
||||
google.protobuf.Timestamp change_date = 4;
|
||||
}
|
||||
|
||||
message DefaultMailTemplate {
|
||||
bytes template = 1;
|
||||
google.protobuf.Timestamp creation_date = 2;
|
||||
google.protobuf.Timestamp change_date = 3;
|
||||
}
|
||||
|
||||
message DefaultMailTemplateUpdate {
|
||||
bytes template = 1;
|
||||
}
|
||||
|
||||
message DefaultMailTemplateView {
|
||||
bytes template = 1;
|
||||
google.protobuf.Timestamp creation_date = 2;
|
||||
google.protobuf.Timestamp change_date = 3;
|
||||
}
|
||||
|
||||
message DefaultMailText {
|
||||
string mail_text_type = 1;
|
||||
string language = 2;
|
||||
string title = 3;
|
||||
string pre_header = 4;
|
||||
string subject = 5;
|
||||
string greeting = 6;
|
||||
string text = 7;
|
||||
string button_text = 8;
|
||||
google.protobuf.Timestamp creation_date = 9;
|
||||
google.protobuf.Timestamp change_date = 10;
|
||||
}
|
||||
|
||||
message DefaultMailTextUpdate {
|
||||
string mail_text_type = 1;
|
||||
string language = 2;
|
||||
string title = 3;
|
||||
string pre_header = 4;
|
||||
string subject = 5;
|
||||
string greeting = 6;
|
||||
string text = 7;
|
||||
string button_text = 8;
|
||||
}
|
||||
|
||||
message DefaultMailTextsView{
|
||||
repeated DefaultMailTextView texts = 1;
|
||||
}
|
||||
|
||||
message DefaultMailTextView {
|
||||
string mail_text_type = 1;
|
||||
string language = 2;
|
||||
string title = 3;
|
||||
string pre_header = 4;
|
||||
string subject = 5;
|
||||
string greeting = 6;
|
||||
string text = 7;
|
||||
string button_text = 8;
|
||||
google.protobuf.Timestamp creation_date = 9;
|
||||
google.protobuf.Timestamp change_date = 10;
|
||||
}
|
||||
|
||||
message DefaultLoginPolicy {
|
||||
bool allow_username_password = 1;
|
||||
bool allow_register = 2;
|
||||
|
Reference in New Issue
Block a user