[英]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.