Skip to content

Commit cbd99f0

Browse files
authored
Merge pull request #138 from idanlevi1/master
Send email from Help Screen
2 parents 9176daf + ccb2b9f commit cbd99f0

File tree

5 files changed

+14
-12
lines changed

5 files changed

+14
-12
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,7 @@ package-lock.json
2121

2222
npm-debug.log*
2323
yarn-debug.log*
24-
yarn-error.log*
24+
yarn-error.log*
25+
26+
#firebase functions
27+
/functions

functions/.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
node_modules/
1+
node_modules/
2+
index.js

functions/index.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ const nodemailer = require('nodemailer');
55
const cors = require('cors')({ origin: true });
66
admin.initializeApp();
77

8-
/**
9-
* Here we're using Gmail to send
10-
*/
118
let transporter = nodemailer.createTransport({
129
service: 'gmail',
1310
auth: {

src/app/initDb.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as firebase from 'firebase'
22
import { keys } from './keys'
3-
// import { ENV, API_KEY, AUTH_DOMAIN, DB_URL, PROJECT_ID, STORAGE_BUCKET, MSG_SENDER_ID } from 'react-native-dotenv'
3+
import { ENV, API_KEY, AUTH_DOMAIN, DB_URL, PROJECT_ID, STORAGE_BUCKET, MSG_SENDER_ID } from 'react-native-dotenv'
44

55
// console.log("TCL: ENV", ENV)
66

@@ -13,12 +13,12 @@ import { keys } from './keys'
1313
// messagingSenderId: MSG_SENDER_ID
1414
// }
1515
const firebaseConfig = {
16-
apiKey: keys.apiKey,
17-
authDomain: keys.authDomain,
18-
databaseURL: keys.databaseURL,
19-
projectId: keys.projectId,
20-
storageBucket: keys.storageBucket,
21-
messagingSenderId: keys.messagingSenderId
16+
apiKey: API_KEY || keys.apiKey,
17+
authDomain: AUTH_DOMAIN || keys.authDomain,
18+
databaseURL: DB_URL || keys.databaseURL,
19+
projectId: PROJECT_ID || keys.projectId,
20+
storageBucket: STORAGE_BUCKET || keys.storageBucket,
21+
messagingSenderId: MSG_SENDER_ID || keys.messagingSenderId
2222
}
2323

2424
export default () => {

src/views/help/HelpView.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ class HelpView extends Component {
2727
const sendEmailFirebaseFunctionUrl = `https://us-central1-happrev.cloudfunctions.net/sendMail?name=${first} ${last}&email=${email}&phone=${phone}&content=${content}`
2828
fetch(sendEmailFirebaseFunctionUrl)
2929
.then((response) => {
30+
console.log("TCL: HelpView -> SandMessage -> response", response)
3031
this.setState({ success: true, modalVisible: true, loading: false })
3132
}).catch((error) => {
3233
this.setState({ modalVisible: true, loading: false })

0 commit comments

Comments
 (0)