[英]Send a form without using endpoint
为了使用这个 npm 包,我需要一个 api 端点,但是如果我想用 smtp 发送它呢?
我没有这种包的经验,所以我会感谢你的帮助!
包是: https : //www.npmjs.com/package/@betahuhn/feedback-js
到目前为止我的实际代码:
const options = {
id: 'feedback', // id to identify the form on the backend
endpoint: baseUrl, // enpoint of your backend to handle the submission
emailField: true, // show email input field, default: false
btnTitle: 'Feedback', // title of button
title: 'Company Feedback', // text at the top
contactText: 'Or send an email!', // text for other contact option
contactLink: Contact, // link for other contact option
typeMessage: 'What feedback do you have?', // message for selecting feedback type
success: 'Thanks! 👊', // message displayed on successfull submission
failedTitle: 'Oops, an error ocurred!', // title displayed on error
failedMessage: 'Please try again. If this keeps happening, try to send an email instead.', // default error message if backend doesn't return one
position: 'right', // position of button left/right
primary: 'rgb(53, 222, 118)', // primary color
background: '#fff', // background color
color: '#000' // font color
}
console.log(Contact);
console.log(baseUrl);
new Feedback(options).attach();
})
我怎样才能以最简单的方式发送它?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.