-
Notifications
You must be signed in to change notification settings - Fork 17
/
email.js
33 lines (27 loc) · 996 Bytes
/
email.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
var prop = require('./properties.js');
var email = require("emailjs");
var server = email.server.connect({
user: prop.user_mail,
password: prop.password_mail,
host: prop.host,
ssl: prop.ssl
});
exports.send = function send (mobile,log) {
if (prop.send_mail == 'yes') {
console.log('Send email with error model:'+log.PHONE_MODEL);
// send the message and get a callback with an error or details of the message that was sent
var text = "Error in "+ log.PHONE_MODEL+";\n";
text += "Date crash:"+ log.USER_CRASH_DATE+"\n";
text += "Android Version:"+log.ANDROID_VERSION+"\n";
text += "App Version Name:"+log.APP_VERSION_NAME+"\n";
text += "App Version Code:"+log.APP_VERSION_CODE+"\n";
text += "Stack:"+log.STACK_TRACE+"\n";
server.send({
text: text,
from: prop.from,
to: prop.to,
cc: "",
subject: prop.subject+ " from Mobile "+mobile
}, function(err, message) { console.log(err || message); });
}
}