@@ -123,7 +123,7 @@ public interface AuthenticationDriver extends CloudServiceDriver { | |||||
static String localePath(final String locale, String templatePath, Handlebars hbs) { | static String localePath(final String locale, String templatePath, Handlebars hbs) { | ||||
final String key = locale+":"+templatePath; | final String key = locale+":"+templatePath; | ||||
return _localePaths.computeIfAbsent(key, | return _localePaths.computeIfAbsent(key, | ||||
k -> HandlebarsUtil.apply(hbs, templatePath, new SingletonMap<>(CTX_LOCALE, locale))); | |||||
k -> HandlebarsUtil.apply(hbs, templatePath, new SingletonMap<>(CTX_LOCALE, locale), '[', ']')); | |||||
} | } | ||||
} | } |
@@ -6,12 +6,13 @@ import lombok.Setter; | |||||
import lombok.experimental.Accessors; | import lombok.experimental.Accessors; | ||||
import org.cobbzilla.mail.sender.SmtpMailConfig; | import org.cobbzilla.mail.sender.SmtpMailConfig; | ||||
import static bubble.ApiConstants.MESSAGE_RESOURCE_BASE; | |||||
import static org.cobbzilla.util.reflect.ReflectionUtil.copy; | import static org.cobbzilla.util.reflect.ReflectionUtil.copy; | ||||
@NoArgsConstructor @Accessors(chain=true) | @NoArgsConstructor @Accessors(chain=true) | ||||
public class EmailDriverConfig extends SmtpMailConfig { | 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); } | public EmailDriverConfig (SmtpMailConfig other) { copy(this, other); } | ||||
@@ -3,8 +3,12 @@ package bubble.cloud.sms; | |||||
import lombok.Getter; | import lombok.Getter; | ||||
import lombok.Setter; | import lombok.Setter; | ||||
import static bubble.ApiConstants.MESSAGE_RESOURCE_BASE; | |||||
public class SmsConfig { | 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; | |||||
} | } |
@@ -51,8 +51,7 @@ | |||||
"type": "email", | "type": "email", | ||||
"driverClass": "{{BUBBLE_SMTP_DRIVER}}", | "driverClass": "{{BUBBLE_SMTP_DRIVER}}", | ||||
"driverConfig": { | "driverConfig": { | ||||
"tlsEnabled": true, | |||||
"templatePath": "message_templates/{{locale}}/email" | |||||
"tlsEnabled": true | |||||
}, | }, | ||||
"credentials": { | "credentials": { | ||||
"params": [ | "params": [ | ||||
@@ -70,9 +69,7 @@ | |||||
"name": "TwilioSms", | "name": "TwilioSms", | ||||
"type": "sms", | "type": "sms", | ||||
"driverClass": "{{BUBBLE_SMS_DRIVER}}", | "driverClass": "{{BUBBLE_SMS_DRIVER}}", | ||||
"driverConfig": { | |||||
"templatePath": "message_templates/{{locale}}/sms" | |||||
}, | |||||
"driverConfig": {}, | |||||
"credentials": { | "credentials": { | ||||
"params": [ | "params": [ | ||||
{"name": "accountSID", "value": "{{TWILIO_ACCOUNT_SID}}"}, | {"name": "accountSID", "value": "{{TWILIO_ACCOUNT_SID}}"}, | ||||