@@ -137,6 +137,32 @@ func (b *BaseURL) WithPath(path string) *URLBuilder {
|
||||
}
|
||||
}
|
||||
|
||||
// WithPath returns a URLBuilder with the specified path.
|
||||
// The path will be properly joined with the base URL's path.
|
||||
func (b *BaseURL) AppendPath(path string) *URLBuilder {
|
||||
if b == nil {
|
||||
return &URLBuilder{err: fmt.Errorf("base URL is nil")}
|
||||
}
|
||||
|
||||
basePath := strings.TrimSuffix(b.parsed.Path, "/")
|
||||
|
||||
// Ensure path starts with /
|
||||
if !strings.HasPrefix(path, "/") {
|
||||
path = "/" + path
|
||||
}
|
||||
|
||||
path = basePath + path
|
||||
|
||||
// Ensure path does not end with /
|
||||
path = strings.TrimSuffix(path, "/")
|
||||
|
||||
return &URLBuilder{
|
||||
base: b,
|
||||
path: path,
|
||||
query: make(url.Values),
|
||||
}
|
||||
}
|
||||
|
||||
// WithQuery adds a query parameter to the URL.
|
||||
func (ub *URLBuilder) WithQuery(key, value string) *URLBuilder {
|
||||
if ub.err != nil {
|
||||
|
||||
@@ -602,7 +602,11 @@ func (s *TrustCenterAccessService) sendDocumentAccessRejectedEmail(
|
||||
return fmt.Errorf("cannot get compliance page email presenter config: %w", err)
|
||||
}
|
||||
|
||||
emailPresenter := emails.NewPresenterFromConfig(emailPresenterCfg, access.Name)
|
||||
fullName := access.Name
|
||||
if fullName == "" {
|
||||
fullName = access.Email.Username()
|
||||
}
|
||||
emailPresenter := emails.NewPresenterFromConfig(emailPresenterCfg, fullName)
|
||||
|
||||
subject, textBody, htmlBody, err := emailPresenter.RenderTrustCenterDocumentAccessRejected(
|
||||
fileNames,
|
||||
|
||||
Reference in New Issue
Block a user