(ctx context.Context)
| 360 | } |
| 361 | |
| 362 | func (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 |
| 377 | func (es *EmailService) SetEmailConfig(ctx context.Context, ec *EmailConfig) (err error) { |
no test coverage detected