【发布时间】:2020-10-05 21:28:40
【问题描述】:
我有一个与 firebase 一起使用的 Angular 应用程序。我已经设置了一个联系表格,供人们与我联系 - 我将通过 Firestore 以电子邮件的形式接收这些消息。我正在使用触发电子邮件扩展程序。我正在接收电子邮件,但是,我没有从输入字段中获取所有信息。
onSubmit() {
console.log('Your form data : ', this.contactForm.value );
const {contactFormName, contactFormEmail, contactFormSubject, contactFormMessage} = this.contactForm.value;
this.af.collection('mail').add({
to: '#####@gmail.com',
message :{
// name: this.contactForm.value.contactFormName,
// email: this.contactForm.value.contactFormEmail,
subject: this.contactForm.value.contactFormSubject,
text: this.contactForm.value.contactFormMessage
}
})
.then(res => {
console.log(res);
this.contactForm.reset();
})
.catch(e => {
console.log(e);
})
}}
Firestore 默认只允许消息、HTML 和文本等字段。我想自定义电子邮件,以便名称+电子邮件也显示在电子邮件正文中,但事实并非如此。 Firestore 建议使用车把来做到这一点,但我不清楚如何做。这里有一个链接供参考:
https://firebase.google.com/products/extensions/firestore-send-email
【问题讨论】:
标签: angular firebase google-cloud-firestore smtp handlebars.js