enter image description hereI just connected my website to firebase to login users but seems to me whenever a user registers on my website the information they put into my website gets scrambled the moment it enters firebase database
this is my code snippet of the js file
//save message to firebase
function saveMessage(Name, Surname, Email, Number, Country, Verpasswrd, Username, Birthday) {
var newMessageRef = messagesRef.push();
newMessageRef.set({
Name: Name,
Surname: Surname,
Birthday: Birthday,
Email: Email,
Number: Number,
Country: Country,
Gender: Gender,
Verpasswrd: Verpasswrd,
Passwrd: Passwrd,
Username: Username,
})
}`
[![firebase output result][2]][2]
Related
I am facing an issue with the emailJS library. I created a function to send a copy of a transaction to an email address using emailJS. However, the API is not receiving any response and I am not getting any output to the console.log. It seems like the function is not even being called. I am not sure what I did wrong and I think it might be a simple fix that I overlooked.
here is the config.js file which contains the user keys and function for mailer i removed all the keys and put in place what belongs there as an fyi to anyone thinking i forgot to fill in the keys
function sendEmail(name, address, city, state, zip, phone, email, amount) {
// Initialize EmailJS with your user ID
emailjs.init("public-key-here");
// Create the email parameters
var templateParams = {
name: name,
address: address,
city: city,
state: state,
zip: zip,
phone: phone,
email: email,
amount: amount
};
// Send the email using EmailJS
emailjs.send("service_ID", "template_ID, templateParams)
.then(function(response) {
console.log("Email sent successfully");
alert("Mail send success");
}, function(error) {
console.log("Email failed to send", error);
alert("Error sending mail");
});
}
And here is the send email function being called on the payment page
// Send email with transaction record and save order details to local storage
sendEmail(name, address, city, state, zip, phone, email, amount);
localStorage.setItem('orderDetails', JSON.stringify({
amount: parseFloat(amount),
name: name,
address: address,
city: city,
state: state,
zip: zip,
phone: phone,
email: email
}));
I get no output in my console.log and or alert that email was success or not. Any help please
What parameter do I need to send social security numbers to Stripe when creating a Connected account?
I know how to send the last 4 but what about all of it?
try {
const account = await stripe.accounts.create({
type: 'custom',
country: 'US',
email: "jake#gmail.com",
business_type: 'individual',
individual: {
email: "jake#gmail.com",
first_name: "Jake",
last_name: "Jake",
ssn_last_4: "4241",
You'd want to pass in id_number (which can be the full SSN) or a PII token from Stripe.js.
I have recently migrated my site from Google Cloud to AWS EC2 and I'm using node.js.
The site is a job website and when I try to submit a file I now get the below error message.
Error: Failed to lookup view "index" in views directory "
The submission works fine on local host ( and also did when it was hosted on GCP). Please can you help me understand why this would be and how to fix it? Here is the code for the CV submission
if (req.file){
console.log("sending CV:"+req.file.path);
var CVLibrary = {
url: 'http://www.website.co.uk/cgi-bin/cvsubapi.pl',
formData:
{
title: title,
firstname: name,
lastname: lastName,
email: email,
county: city,
town: address2,
postcode: postCode,
telephone: phone,
salary: salary,
age: Age,
affiliateID: 20998,
industry: "Retail",
affiliatepassword: "coregalm",
currentjobtitle: jobCategories ,
doc: {
value: fs.createReadStream(req.file.path),
options: {
contentType: "application/msword",
filename: "cv.docx"
}
}
}
};
console.log("CV data:" + JSON.stringify(CVLibrary));
request.post(CVLibrary, function (error, response, body) {
if (error) {
console.log("CV Library request sent with error" + error + " body." + body);
//res.status(400).send(error);
} else {
//res.set('Content-Type', 'text/html');
//res.send(new Buffer(body));
console.log("request sent correctly CV Library:" + body);
//res.send(body)
}
});
res.render('learnnewskills', {
title: 'Welcome to job site', userInfo: {
title: title,
name,
firstname: name,
lastname: lastName,
email: email,
mobile: phone,
subAffiliate: listId,
dob: dob_day + '/' + dob_month + '/' + dob_year,
optindate: currentTimestamp,
street1: address1,
address2,
towncity: city,
postcode: postCode,
tickYes,
tickYes1,
ipaddress: ipaddress,
courseInterestYes:"",
specificCourseInterest:"",
costAwareYes:"",
currentJob,
list: listId,
currentTimestamp,
redcoursetickyes:"",
penaltyPoints:"",
DrivingBan:"",
Redlicence:""
}
});
});
I'm creating an Axios request function where I have a looot of parameters for the body request. Most are required, but some are not. What's the best way to handle this?
createAccount(username, first_name, last_name, email, language, client_name, client_email, website_url, street, city, code, country, language, lead_source, date_picker) {
return this.axiosInstance.post('/brands/image', {
username: username,
first_name: first_name,
last_name: last_name,
email: email,
language: language,
client_name: client_name,
client_email: client_email,
website: website,
street: street,
city: city,
code: code,
country: country,
lead_source: lead_source, // non-required
date_picker: date_picker, // // non-required
})
.catch(error => {
console.log("Error: ", error)
})
}
There are two basic approaches you can take:
Read the API documentation of the web service you are making requests to (which could be designed for humans or might be a machine readable JSON schema or similar)
Trial and error
There's no way for the client to know what the server cares about.
I'm trying to use postUserData so that if a person fills in and submits a form on one page of my website, it submits the data to a form on a different page on my website.
It all worked until I introduced a checkbox named writerep to my form, as my CMS autogenerates the checkbox name on the final form (in this case, the catchy "custom-1798_0", and because that ID/name contains a hyphen, it breaks the JSON. Other checkbox without hyphen works fine. Code below:
$('#user_info_form').validate({
submitHandler: function submitHandler(form, e) {
e.preventDefault();
var firstname = e.target.firstname.value;
var lastname = e.target.lastname.value;
var email = e.target.email.value;
var country = e.target.country.value;
var writerep = e.target.writerep.checked;
var emailopt = e.target.emailopt.checked;
userInfo = {
firstname: firstname,
lastname: lastname,
email: email,
country: country,
custom-1798_0: writerep? 1 : 0,
email_opt_in: emailopt ? 1 : 0
};
postUserData(userInfo, 'https://*********');
nextSlide('.slide1');
},
rules: {
firstname: "required",
lastname: "required",
country: "required",
email: {
required: true,
email: true
}
},
messages: {
firstname: "Please enter your first name",
lastname: "Please enter your last name",
country: "Please select your country",
email: {
required: "Please enter your email address",
email: "Please enter a valid email address"
}
}
});
Without renaming the checkbox on the final form, which isn't possible due to CMS limitations, is there a way of making this work?
You have to quote property names that have special characters or spaces in them. Some are allowed like $ and _ but - is not since it is also an operator
userInfo = {
firstname: firstname,
lastname: lastname,
email: email,
country: country,
'custom-1798_0': writerep? 1 : 0,
email_opt_in: emailopt ? 1 : 0
};