Commit 217abcceeb64b705dde82e1c57541a3e0666450f
1 parent
d0099dd882
Exists in
master
added a way to run meteor with settings file
Showing
17 changed files
with
144 additions
and
108 deletions
Show diff stats
imports/server/accounts.js
... | ... | @@ -1,9 +0,0 @@ |
1 | -import '/imports/server/emails/config'; | |
2 | -import './accounts/email-templates'; | |
3 | -import './accounts/verifyEmail'; | |
4 | -import './accounts/login'; | |
5 | -import './accounts/resetPassword'; | |
6 | -import '/imports/server/emails/invite'; | |
7 | -import '/imports/server/pages/verifyEmail'; | |
8 | - | |
9 | -import './accounts/creation'; |
imports/server/accounts/email-templates.js
... | ... | @@ -1,25 +0,0 @@ |
1 | -import { Accounts } from 'meteor/accounts-base'; | |
2 | - | |
3 | -const name = 'Application Name'; | |
4 | -const email = '<support@application.com>'; | |
5 | -const from = `${name} ${email}`; | |
6 | -const emailTemplates = Accounts.emailTemplates; | |
7 | - | |
8 | -emailTemplates.siteName = name; | |
9 | -emailTemplates.from = from; | |
10 | - | |
11 | -emailTemplates.resetPassword = { | |
12 | - subject() { | |
13 | - return `[${name}] Reset Your Password`; | |
14 | - }, | |
15 | - text(user, url) { | |
16 | - const userEmail = user.emails[0].address; | |
17 | - const urlWithoutHash = url.replace('#/', ''); | |
18 | - | |
19 | - return `A password reset has been requested for the account related to this | |
20 | - address (${userEmail}). To reset the password, visit the following link: | |
21 | - \n\n${urlWithoutHash}\n\n If you did not request this reset, please ignore | |
22 | - this email. If you feel something is wrong, please contact our support team: | |
23 | - ${email}.`; | |
24 | - }, | |
25 | -}; |
imports/server/accounts/index.js
imports/server/accounts/resetPassword.js
... | ... | @@ -1,31 +0,0 @@ |
1 | -import _ from 'lodash'; | |
2 | -import { Accounts } from 'meteor/accounts-base'; | |
3 | - | |
4 | - | |
5 | -Accounts.emailTemplates.resetPassword = { | |
6 | - subject() { | |
7 | - return '[Blok8] Reset Your Password'; | |
8 | - }, | |
9 | - text(user, url) { | |
10 | - const userEmail = user.emails[0].address; | |
11 | - const theUrl = Meteor.absoluteUrl(`?enter=reset&token=${_.last(url.split('/'))}`); | |
12 | - // const theUrl = decodeURI(`\u003D`); | |
13 | - | |
14 | - return ( | |
15 | -` | |
16 | -Hello, ${user.firstName}! | |
17 | - | |
18 | - | |
19 | -A password reset has been requested for the account related to this address. | |
20 | -To reset the password, visit the following link: | |
21 | - | |
22 | -${theUrl} | |
23 | - | |
24 | -If you did not request this reset, please ignore this email. | |
25 | - | |
26 | -` | |
27 | - ); | |
28 | - }, | |
29 | -}; | |
30 | - | |
31 | - |
imports/server/accounts/verifyEmail.js
... | ... | @@ -1,29 +0,0 @@ |
1 | -import _ from 'lodash'; | |
2 | -import { Accounts } from 'meteor/accounts-base'; | |
3 | - | |
4 | -Accounts.config({ | |
5 | - sendVerificationEmail: true | |
6 | -}); | |
7 | - | |
8 | -Accounts.emailTemplates.verifyEmail = { | |
9 | - subject() { | |
10 | - return '[YoungDesk] Verify Your Email Address'; | |
11 | - }, | |
12 | - text(user, url) { | |
13 | - const theUrl = Meteor.absoluteUrl(`back/verifyEmail/${_.last(url.split('/'))}`); | |
14 | - | |
15 | - return ( | |
16 | -` | |
17 | -Hello, ${user.firstName}! | |
18 | - | |
19 | - | |
20 | -To verify your email address, visit the following link: | |
21 | - | |
22 | -${theUrl} | |
23 | - | |
24 | -If you did not request this verification, please ignore this email. | |
25 | - | |
26 | -` | |
27 | - ); | |
28 | - }, | |
29 | -}; |
imports/server/emails/config.js
... | ... | @@ -3,8 +3,7 @@ |
3 | 3 | |
4 | 4 | import { Accounts } from 'meteor/accounts-base'; |
5 | 5 | |
6 | -if(Meteor.settings.public.environment === 'production') { | |
7 | - process.env.MAIL_URL = "smtp://block8:Ih-DuTSHlO-bdiPE7FBl3Q@smtp.mandrillapp.com:587"; | |
8 | -} | |
6 | +process.env.MAIL_URL = Meteor.settings.private.mandrill.mailUrl; | |
9 | 7 | Accounts.emailTemplates.siteName = 'YoungDesk'; |
10 | 8 | Accounts.emailTemplates.from = 'YoungDesk <support@youngdesk.com>'; |
9 | +console.log(Accounts.emailTemplates.from); | ... | ... |
imports/server/emails/index.js
imports/server/emails/invite.js
... | ... | @@ -14,9 +14,9 @@ ${url} |
14 | 14 | `; |
15 | 15 | |
16 | 16 | Email.send({ |
17 | - from: 'Blok 8 <support@mystake.io>', | |
17 | + from: 'YoungDesk <support@youngdesk.com>', | |
18 | 18 | to: email, |
19 | - subject: `[Blok8] Invitation to ${orgName}`, | |
19 | + subject: `[YoungDesk] Invitation`, | |
20 | 20 | text: text, |
21 | 21 | }); |
22 | 22 | |
... | ... | @@ -30,7 +30,7 @@ The current share price has been changed to $A${price} for the company ${orgName |
30 | 30 | `; |
31 | 31 | |
32 | 32 | Email.send({ |
33 | - from: 'Blok 8 <support@mystake.io>', | |
33 | + from: 'Blok 8 <support@youngdesk.com>', | |
34 | 34 | to: email, |
35 | 35 | subject: `[Blok8] Share price has changed for ${orgName}.`, |
36 | 36 | text: text, |
... | ... | @@ -52,7 +52,7 @@ If you did not change your name, please reset your password. |
52 | 52 | `; |
53 | 53 | |
54 | 54 | Email.send({ |
55 | - from: 'Blok 8 <support@mystake.io>', | |
55 | + from: 'Blok 8 <support@youngdesk.com>', | |
56 | 56 | to: email, |
57 | 57 | subject: `[Blok8] - Name Change`, |
58 | 58 | text: text, |
... | ... | @@ -75,7 +75,7 @@ If you did not change your password, please reset your password immediately. |
75 | 75 | `; |
76 | 76 | |
77 | 77 | Email.send({ |
78 | - from: 'Blok 8 <support@mystake.io>', | |
78 | + from: 'Blok 8 <support@youngdesk.com>', | |
79 | 79 | to: email, |
80 | 80 | subject: `[Blok8] - Password Change`, |
81 | 81 | text: text, |
... | ... | @@ -98,7 +98,7 @@ If you did not change your email address, please contact us immediately by respo |
98 | 98 | `; |
99 | 99 | |
100 | 100 | Email.send({ |
101 | - from: 'Blok 8 <support@mystake.io>', | |
101 | + from: 'Blok 8 <support@youngdesk.com>', | |
102 | 102 | to: email, |
103 | 103 | subject: `[Blok8] - Email Change`, |
104 | 104 | text: text, |
... | ... | @@ -120,7 +120,7 @@ ${quantity} ${shareClass} shares in ${orgName} have been issued to you for A$${p |
120 | 120 | `; |
121 | 121 | |
122 | 122 | Email.send({ |
123 | - from: 'Blok 8 <support@mystake.io>', | |
123 | + from: 'Blok 8 <support@youngdesk.com>', | |
124 | 124 | to: email, |
125 | 125 | subject: `[Blok8] New shares have been issued to you in ${orgName}.`, |
126 | 126 | text: text, |
... | ... | @@ -139,7 +139,7 @@ Title: ${title}. |
139 | 139 | `; |
140 | 140 | |
141 | 141 | Email.send({ |
142 | - from: 'Blok 8 <support@mystake.io>', | |
142 | + from: 'Blok 8 <support@youngdesk.com>', | |
143 | 143 | to: email, |
144 | 144 | subject: `[Blok8] ${orgName} - New Announcement`, |
145 | 145 | text: text, | ... | ... |
imports/server/emails/resetPassword.js
... | ... | @@ -0,0 +1,30 @@ |
1 | +import _ from 'lodash'; | |
2 | +import { Accounts } from 'meteor/accounts-base'; | |
3 | + | |
4 | + | |
5 | +Accounts.emailTemplates.resetPassword = { | |
6 | + subject() { | |
7 | + return '[YoungDesk] Reset Your Password'; | |
8 | + }, | |
9 | + text(user, url) { | |
10 | + console.log(user); | |
11 | + const userEmail = user.emails[0].address; | |
12 | + const theUrl = Meteor.absoluteUrl(`?enter=reset&token=${_.last(url.split('/'))}`); | |
13 | + // const theUrl = decodeURI(`\u003D`); | |
14 | + | |
15 | + return ( | |
16 | +` | |
17 | +Hello, ${user.firstName}! | |
18 | + | |
19 | + | |
20 | +A password reset has been requested for the account related to this address. | |
21 | +To reset the password, visit the following link: | |
22 | + | |
23 | +${theUrl} | |
24 | + | |
25 | +If you did not request this reset, please ignore this email. | |
26 | + | |
27 | +` | |
28 | + ); | |
29 | + }, | |
30 | +}; | ... | ... |
imports/server/emails/verifyEmail.js
... | ... | @@ -0,0 +1,36 @@ |
1 | +import _ from 'lodash'; | |
2 | +import { Accounts } from 'meteor/accounts-base'; | |
3 | + | |
4 | +Accounts.config({ | |
5 | + sendVerificationEmail: true | |
6 | +}); | |
7 | + | |
8 | +Accounts.emailTemplates.verifyEmail = { | |
9 | + subject() { | |
10 | + return '[YoungDesk] Verify Your Email Address'; | |
11 | + }, | |
12 | + text(user, url) { | |
13 | + console.log(user); | |
14 | + if(user.firstName){ | |
15 | + const name = user.firstName; | |
16 | + }else{ | |
17 | + const name = user.profile.firstName; | |
18 | + } | |
19 | + const name = user.firstName; | |
20 | + const theUrl = Meteor.absoluteUrl(`back/verifyEmail/${_.last(url.split('/'))}`); | |
21 | + | |
22 | + return ( | |
23 | +` | |
24 | +Hello, ${name}! | |
25 | + | |
26 | + | |
27 | +To verify your email address, visit the following link: | |
28 | + | |
29 | +${theUrl} | |
30 | + | |
31 | +If you did not request this verification, please ignore this email. | |
32 | + | |
33 | +` | |
34 | + ); | |
35 | + }, | |
36 | +}; | ... | ... |
imports/server/index.js
run/app
run/app.sh
run/debug
run/echo
... | ... | @@ -0,0 +1,18 @@ |
1 | +#!/bin/bash | |
2 | + | |
3 | + | |
4 | +echo -e "" | |
5 | +echo -e "" | |
6 | +echo -e "\033[96m\033[1m ╔════════════════════════╗ \033[0m" | |
7 | +echo -e "\033[96m\033[1m ║ ╔════════════════════╗ ║ \033[0m" | |
8 | +echo -e "\033[96m\033[1m ║ ║ ║ ║ \033[0m" | |
9 | +echo -e "\033[96m\033[1m ║ ║ YoungDesk ║ ║ \033[0m" | |
10 | +echo -e "\033[96m\033[1m ║ ║ ║ ║ \033[0m" | |
11 | +echo -e "\033[96m\033[1m ║ ╟────────────────────╢ ║ \033[0m" | |
12 | +echo -e "\033[96m\033[1m ║ ║ ║ ║ \033[0m" | |
13 | +echo -e "\033[96m\033[1m ║ ║ \033[91m\033[1m$1\033[96m\033[1m ║ ║ \033[0m" | |
14 | +echo -e "\033[96m\033[1m ║ ║ ║ ║ \033[0m" | |
15 | +echo -e "\033[96m\033[1m ║ ╚══════╗\033[91m\033[1m╔════╗\033[96m\033[1m╔══════╝ ║ \033[0m" | |
16 | +echo -e "\033[96m\033[1m ╚════════╝\033[91m\033[1m╚════╝\033[96m\033[1m╚════════╝ \033[0m" | |
17 | +echo -e "" | |
18 | +echo -e "" | ... | ... |
run/reset_meteor
settings-development.json
1 | 1 | { |
2 | - "public": {}, | |
3 | - "private": {} | |
2 | + "private": { | |
3 | + "twilio": { | |
4 | + "accountSID": "", | |
5 | + "authToken": "", | |
6 | + "from": "" | |
7 | + }, | |
8 | + "mandrill": { | |
9 | + "key": "jr9TRxivdGDrsyI_bmRZLg", | |
10 | + "testKey": "UbqDNTDINDq5fCAkzb0-DQ", | |
11 | + "mailUrl": "smtp://Youngdesk:3AY0e6pF9Alpv5-GjrQxAA@smtp.mandrillapp.com:587" | |
12 | + } | |
13 | + }, | |
14 | + "public": { | |
15 | + "environment": "development" | |
16 | + } | |
4 | 17 | } | ... | ... |