繁体   English   中英

Azure SendGrid已连接到UI的create-react-app

[英]Azure SendGrid connected to create-react-app for UI

因此,我使用Azure中的create-react-app我的应用create-react-app ,但是需要添加提交表单后发送邮件的功能。 我知道这不能在我的react应用程序中完成,但是由于远离后端工作,我试图搜索一个教程或一些可以指导我的事情,并使用sendgrid设置某种node.js ,以便UI现在可以处理使用我的表单发送电子邮件。 你们中的任何人都可以推荐一些指导,教程等...来帮助您解决此问题,因为我在Sendgrid网站上没有看到相关内容。

谢谢您的帮助。

检查库sendgrid-nodejs库,其中包括Node.js的详细示例:

 const sgMail = require('@sendgrid/mail'); sgMail.setApiKey(process.env.SENDGRID_API_KEY); const msg = { to: 'test@example.com', from: 'test@example.com', subject: 'Sending with SendGrid is Fun', text: 'and easy to do anywhere, even with Node.js', html: '<strong>and easy to do anywhere, even with Node.js</strong>', }; sgMail.send(msg); 

有关更复杂的用例,请参见USE_CASES.md

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM