MCPcopy Create free account
hub / github.com/apache/answer / GetEmailConfig

Method GetEmailConfig

internal/service/export/email_service.go:362–374  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

360}
361
362func (es *EmailService) GetEmailConfig(ctx context.Context) (ec *EmailConfig, err error) {
363 emailConf, err := es.configService.GetStringValue(ctx, constant.EmailConfigKey)
364 if err != nil {
365 return nil, err
366 }
367 ec = &EmailConfig{}
368 err = json.Unmarshal([]byte(emailConf), ec)
369 if err != nil {
370 log.Errorf("old email config format is invalid, you need to update smtp config: %v", err)
371 return nil, errors.BadRequest(reason.SiteInfoConfigNotFound)
372 }
373 return ec, nil
374}
375
376// SetEmailConfig set email config
377func (es *EmailService) SetEmailConfig(ctx context.Context, ec *EmailConfig) (err error) {

Callers 3

SendMethod · 0.95
GetSMTPConfigMethod · 0.80
UpdateSMTPConfigMethod · 0.80

Calls 1

GetStringValueMethod · 0.80

Tested by

no test coverage detected