Browse Source

Merge branch 'master' of github.com:Budibase/budibase into linked-records

master
Andrew Kingston 6 years ago
parent
commit
ea7e17ce60
  1. 12
      packages/builder/src/components/settings/tabs/APIKeys.svelte
  2. 1
      packages/server/src/api/controllers/apikeys.js
  3. 10
      packages/server/src/automations/steps/sendEmail.js
  4. 6
      readme.md

12
packages/builder/src/components/settings/tabs/APIKeys.svelte

@ -1,11 +1,9 @@
<script> <script>
import { Input, Button } from "@budibase/bbui" import { Input } from "@budibase/bbui"
import { store } from "builderStore"
import api from "builderStore/api" import api from "builderStore/api"
import posthog from "posthog-js"
import analytics from "analytics" import analytics from "analytics"
let keys = { budibase: "", sendGrid: "" } let keys = { budibase: "" }
async function updateKey([key, value]) { async function updateKey([key, value]) {
if (key === "budibase") { if (key === "budibase") {
@ -40,12 +38,6 @@
edit edit
value={keys.budibase} value={keys.budibase}
label="Budibase API Key" /> label="Budibase API Key" />
<Input
on:save={e => updateKey(['sendgrid', e.detail])}
thin
edit
value={keys.sendgrid}
label="Sendgrid API Key" />
</div> </div>
<style> <style>

1
packages/server/src/api/controllers/apikeys.js

@ -7,7 +7,6 @@ exports.fetch = async function(ctx) {
ctx.status = 200 ctx.status = 200
ctx.body = { ctx.body = {
budibase: process.env.BUDIBASE_API_KEY, budibase: process.env.BUDIBASE_API_KEY,
sendgrid: process.env.SENDGRID_API_KEY,
userId: process.env.USERID_API_KEY, userId: process.env.USERID_API_KEY,
} }
} }

10
packages/server/src/automations/steps/sendEmail.js

@ -1,7 +1,3 @@
const environment = require("../../environment")
const sgMail = require("@sendgrid/mail")
sgMail.setApiKey(environment.SENDGRID_API_KEY)
module.exports.definition = { module.exports.definition = {
description: "Send an email", description: "Send an email",
tagline: "Send email to {{inputs.to}}", tagline: "Send email to {{inputs.to}}",
@ -13,6 +9,10 @@ module.exports.definition = {
schema: { schema: {
inputs: { inputs: {
properties: { properties: {
apiKey: {
type: "string",
title: "SendGrid API key",
},
to: { to: {
type: "string", type: "string",
title: "Send To", title: "Send To",
@ -49,6 +49,8 @@ module.exports.definition = {
} }
module.exports.run = async function({ inputs }) { module.exports.run = async function({ inputs }) {
const sgMail = require("@sendgrid/mail")
sgMail.setApiKey(inputs.apiKey)
const msg = { const msg = {
to: inputs.to, to: inputs.to,
from: inputs.from, from: inputs.from,

6
readme.md

@ -1,3 +1,9 @@
# Budibase is in Beta
Budibase is currently beta software. Until our official launch, we cannot ensure backwards compatibility for your budibase applications between versions. Issues may arise when trying to edit apps created with old versions of the budibase builder.
If you are having issues between updates of the builder, please use the guide [here](https://github.com/Budibase/budibase/blob/master/CONTRIBUTING.md#troubleshooting) to clear down your environment.
# What is Budibase? # What is Budibase?

Loading…
Cancel
Save