Skip to content

Commit

Permalink
fix config key (@materia/mailjet)
Browse files Browse the repository at this point in the history
  • Loading branch information
thyb committed Feb 27, 2017
1 parent d59a7a8 commit 6cc2940
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion server/models/email.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"type": "text",
"read": true,
"write": true,
"component": "markdown"
"component": "textarea"
},
{
"name": "to",
Expand Down
4 changes: 2 additions & 2 deletions server/models/queries/email.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 4 additions & 4 deletions web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
<div style="text-align: center; font-size: 2.5em">{{nbEmails}}</div>
<div style="text-align: center">email{{ nbEmails > 1 ? 's' : '' }} sent</div>
</div>
<div style="padding-top: 15px; margin-left: 20px" flex ng-show="app.addons.addonsConfig['mailjet'].from && app.addons.addonsConfig['mailjet'].apikey">
Emails are sent from <strong>{{app.addons.addonsConfig['mailjet'].from}}</strong> with <strong>Mailjet</strong>
<br>using the following Mailjet APIKey: <strong>{{app.addons.addonsConfig['mailjet'].apikey.substr(0, 5) + '*****' + app.addons.addonsConfig['mailjet'].apikey.substr(-5, 5)}}</strong>
<div style="padding-top: 15px; margin-left: 20px" flex ng-show="app.addons.addonsConfig['@materia/mailjet'].from && app.addons.addonsConfig['@materia/mailjet'].apikey">
Emails are sent from <strong>{{app.addons.addonsConfig['@materia/mailjet'].from}}</strong> with <strong>Mailjet</strong>
<br>using the following Mailjet APIKey: <strong>{{app.addons.addonsConfig['@materia/mailjet'].apikey.substr(0, 5) + '*****' + app.addons.addonsConfig['@materia/mailjet'].apikey.substr(-5, 5)}}</strong>
<br><a href="#">Edit the configuration</a>
</div>
<div style="padding-top: 15px; margin-left: 20px" flex ng-show="app.addons.addonsConfig['mailjet'].from && app.addons.addonsConfig['mailjet'].apikey">
<div style="padding-top: 15px; margin-left: 20px" flex ng-show="app.addons.addonsConfig['@materia/mailjet'].from && app.addons.addonsConfig['@materia/mailjet'].apikey">
You need to configure this addon to send email in your application.
<br><a href="#">Configure it now!</a>
</div>
Expand Down

0 comments on commit 6cc2940

Please sign in to comment.