From 6cc294098c052c3f7dead32bd17be504787f7a2a Mon Sep 17 00:00:00 2001 From: Thibaud Arnault Date: Mon, 27 Feb 2017 06:18:48 -0400 Subject: [PATCH] fix config key (@materia/mailjet) --- package.json | 2 +- server/models/email.json | 2 +- server/models/queries/email.js | 4 ++-- web/index.html | 8 ++++---- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index 2abb024..8b82d31 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@materia/mailjet", - "version": "0.1.0", + "version": "0.1.1", "description": "Send emails in your application using Mailjet", "main": "index.js", "scripts": { diff --git a/server/models/email.json b/server/models/email.json index 1ed6189..7aef2c9 100644 --- a/server/models/email.json +++ b/server/models/email.json @@ -17,7 +17,7 @@ "type": "text", "read": true, "write": true, - "component": "markdown" + "component": "textarea" }, { "name": "to", diff --git a/server/models/queries/email.js b/server/models/queries/email.js index 8603a06..0b742bf 100644 --- a/server/models/queries/email.js +++ b/server/models/queries/email.js @@ -4,12 +4,12 @@ class EmailModel { constructor(app, entity) { this.app = app; this.entity = entity; - this.emailSender = new MailjetSender(app.addons.addonsConfig['mailjet'].apikey, app.addons.addonsConfig['mailjet'].secret, app.addons.addonsConfig['mailjet'].from, app.addons.addonsConfig['mailjet'].name) + this.emailSender = new MailjetSender(app.addons.addonsConfig['@materia/mailjet'].apikey, app.addons.addonsConfig['@materia/mailjet'].secret, app.addons.addonsConfig['@materia/mailjet'].from, app.addons.addonsConfig['@materia/mailjet'].name) } send(params) { return this.emailSender.send(params).then(() => { - params.from = this.app.addons.addonsConfig['mailjet'].from + params.from = this.app.addons.addonsConfig['@materia/mailjet'].from params.date_sent = new Date() return this.entity.getQuery('create') .run(params) diff --git a/web/index.html b/web/index.html index bf97cab..06a39bb 100644 --- a/web/index.html +++ b/web/index.html @@ -4,12 +4,12 @@
{{nbEmails}}
email{{ nbEmails > 1 ? 's' : '' }} sent
-
- Emails are sent from {{app.addons.addonsConfig['mailjet'].from}} with Mailjet -
using the following Mailjet APIKey: {{app.addons.addonsConfig['mailjet'].apikey.substr(0, 5) + '*****' + app.addons.addonsConfig['mailjet'].apikey.substr(-5, 5)}} +
+ Emails are sent from {{app.addons.addonsConfig['@materia/mailjet'].from}} with Mailjet +
using the following Mailjet APIKey: {{app.addons.addonsConfig['@materia/mailjet'].apikey.substr(0, 5) + '*****' + app.addons.addonsConfig['@materia/mailjet'].apikey.substr(-5, 5)}}
Edit the configuration
-
+
You need to configure this addon to send email in your application.
Configure it now!