ソースを参照

fix default template paths for email/sms

tags/v0.1.6
Jonathan Cobb 4年前
コミット
e0acf34fa5
4個のファイルの変更10行の追加8行の削除
  1. +1
    -1
      bubble-server/src/main/java/bubble/cloud/auth/AuthenticationDriver.java
  2. +2
    -1
      bubble-server/src/main/java/bubble/cloud/email/EmailDriverConfig.java
  3. +5
    -1
      bubble-server/src/main/java/bubble/cloud/sms/SmsConfig.java
  4. +2
    -5
      bubble-server/src/test/resources/models/system/cloudService.json

+ 1
- 1
bubble-server/src/main/java/bubble/cloud/auth/AuthenticationDriver.java ファイルの表示

@@ -123,7 +123,7 @@ public interface AuthenticationDriver extends CloudServiceDriver {
static String localePath(final String locale, String templatePath, Handlebars hbs) {
final String key = locale+":"+templatePath;
return _localePaths.computeIfAbsent(key,
k -> HandlebarsUtil.apply(hbs, templatePath, new SingletonMap<>(CTX_LOCALE, locale)));
k -> HandlebarsUtil.apply(hbs, templatePath, new SingletonMap<>(CTX_LOCALE, locale), '[', ']'));
}

}

+ 2
- 1
bubble-server/src/main/java/bubble/cloud/email/EmailDriverConfig.java ファイルの表示

@@ -6,12 +6,13 @@ import lombok.Setter;
import lombok.experimental.Accessors;
import org.cobbzilla.mail.sender.SmtpMailConfig;

import static bubble.ApiConstants.MESSAGE_RESOURCE_BASE;
import static org.cobbzilla.util.reflect.ReflectionUtil.copy;

@NoArgsConstructor @Accessors(chain=true)
public class EmailDriverConfig extends SmtpMailConfig {

public static final String DEFAULT_TEMPLATE_PATH = "message_templates/email";
public static final String DEFAULT_TEMPLATE_PATH = MESSAGE_RESOURCE_BASE+"[[locale]]/email";

public EmailDriverConfig (SmtpMailConfig other) { copy(this, other); }



+ 5
- 1
bubble-server/src/main/java/bubble/cloud/sms/SmsConfig.java ファイルの表示

@@ -3,8 +3,12 @@ package bubble.cloud.sms;
import lombok.Getter;
import lombok.Setter;

import static bubble.ApiConstants.MESSAGE_RESOURCE_BASE;

public class SmsConfig {

@Getter @Setter private String templatePath;
public static final String DEFAULT_TEMPLATE_PATH = MESSAGE_RESOURCE_BASE+"[[locale]]/sms";

@Getter @Setter private String templatePath = DEFAULT_TEMPLATE_PATH;

}

+ 2
- 5
bubble-server/src/test/resources/models/system/cloudService.json ファイルの表示

@@ -51,8 +51,7 @@
"type": "email",
"driverClass": "{{BUBBLE_SMTP_DRIVER}}",
"driverConfig": {
"tlsEnabled": true,
"templatePath": "message_templates/{{locale}}/email"
"tlsEnabled": true
},
"credentials": {
"params": [
@@ -70,9 +69,7 @@
"name": "TwilioSms",
"type": "sms",
"driverClass": "{{BUBBLE_SMS_DRIVER}}",
"driverConfig": {
"templatePath": "message_templates/{{locale}}/sms"
},
"driverConfig": {},
"credentials": {
"params": [
{"name": "accountSID", "value": "{{TWILIO_ACCOUNT_SID}}"},


読み込み中…
キャンセル
保存