diff --git a/bubble-server/src/main/java/bubble/service/cloud/StandardNetworkService.java b/bubble-server/src/main/java/bubble/service/cloud/StandardNetworkService.java index 217552aa..13f11b23 100644 --- a/bubble-server/src/main/java/bubble/service/cloud/StandardNetworkService.java +++ b/bubble-server/src/main/java/bubble/service/cloud/StandardNetworkService.java @@ -10,12 +10,17 @@ import bubble.cloud.dns.DnsServiceDriver; import bubble.dao.account.AccountDAO; import bubble.dao.account.AccountPolicyDAO; import bubble.dao.account.AccountSshKeyDAO; +import bubble.dao.account.message.AccountMessageDAO; import bubble.dao.bill.AccountPlanDAO; import bubble.dao.bill.BubblePlanDAO; import bubble.dao.cloud.*; import bubble.model.account.Account; import bubble.model.account.AccountPolicy; import bubble.model.account.AccountSshKey; +import bubble.model.account.message.AccountAction; +import bubble.model.account.message.AccountMessage; +import bubble.model.account.message.AccountMessageType; +import bubble.model.account.message.ActionTarget; import bubble.model.bill.AccountPlan; import bubble.model.bill.BubblePlan; import bubble.model.cloud.*; @@ -109,6 +114,7 @@ public class StandardNetworkService implements NetworkService { @Autowired private AnsibleRoleDAO roleDAO; @Autowired private AccountPlanDAO accountPlanDAO; @Autowired private AccountPolicyDAO policyDAO; + @Autowired private AccountMessageDAO accountMessageDAO; @Autowired private BubblePlanDAO planDAO; @Autowired private NotificationService notificationService; @@ -566,6 +572,15 @@ public class StandardNetworkService implements NetworkService { .setRegion(cloudAndRegion.getRegion().getInternalName()) .setLock(lock); + // notify user that new bubble is launching + accountMessageDAO.create(new AccountMessage() + .setAccount(accountUuid) + .setNetwork(network.getUuid()) + .setName(network.getUuid()) + .setMessageType(AccountMessageType.notice) + .setTarget(ActionTarget.network) + .setAction(AccountAction.start)); + // start background process to create node backgroundNewNode(newNodeRequest, lock); diff --git a/bubble-server/src/main/resources/message_templates/en_US/email/notice/start/network/fromEmail.hbs b/bubble-server/src/main/resources/message_templates/en_US/email/notice/start/network/fromEmail.hbs new file mode 100644 index 00000000..07124186 --- /dev/null +++ b/bubble-server/src/main/resources/message_templates/en_US/email/notice/start/network/fromEmail.hbs @@ -0,0 +1 @@ +no-reply@{{network.networkDomain}} \ No newline at end of file diff --git a/bubble-server/src/main/resources/message_templates/en_US/email/notice/start/network/fromName.hbs b/bubble-server/src/main/resources/message_templates/en_US/email/notice/start/network/fromName.hbs new file mode 100644 index 00000000..1178b0e8 --- /dev/null +++ b/bubble-server/src/main/resources/message_templates/en_US/email/notice/start/network/fromName.hbs @@ -0,0 +1 @@ +{{network.networkDomain}} System Account \ No newline at end of file diff --git a/bubble-server/src/main/resources/message_templates/en_US/email/notice/start/network/message.hbs b/bubble-server/src/main/resources/message_templates/en_US/email/notice/start/network/message.hbs new file mode 100644 index 00000000..e427ebcd --- /dev/null +++ b/bubble-server/src/main/resources/message_templates/en_US/email/notice/start/network/message.hbs @@ -0,0 +1,16 @@ +Hello {{account.name}}, + +Congratulations, your new Bubble is launching. It typically takes about 20 minutes to set itself up. + +When your Bubble has finished its self-setup process, it will send you a message with a link to unlock it. + +You'll need to install the Wireguard application on each device that will connect to your Bubble. + +While you're waiting for your Bubble to be ready, go ahead and install the Wireguard application on each +device you will connect to your Bubble. + +Instruction for installing Wireguard can be found here: https://bubblev.com/get-ready + +If you have any difficulties installing Wireguard or using your new Bubble, please contact support@bubblev.com + +Thank you for using Bubble! diff --git a/bubble-server/src/main/resources/message_templates/en_US/email/notice/start/network/subject.hbs b/bubble-server/src/main/resources/message_templates/en_US/email/notice/start/network/subject.hbs new file mode 100644 index 00000000..5dc63e4a --- /dev/null +++ b/bubble-server/src/main/resources/message_templates/en_US/email/notice/start/network/subject.hbs @@ -0,0 +1 @@ +{{network.networkDomain}}: Your new Bubble is launching \ No newline at end of file diff --git a/bubble-server/src/main/resources/message_templates/en_US/sms/notice/start/network/message.hbs b/bubble-server/src/main/resources/message_templates/en_US/sms/notice/start/network/message.hbs new file mode 100644 index 00000000..873d9a7d --- /dev/null +++ b/bubble-server/src/main/resources/message_templates/en_US/sms/notice/start/network/message.hbs @@ -0,0 +1 @@ +Your new Bubble is launching! This usually takes about 20 minutes. While you wait, get your devices ready: https://bubblev.com/get-ready \ No newline at end of file