我正在尝试使用mailgun适配器向我的用户发送密码重置电子邮件,但是我无法发送电子邮件。在客户端我打电话:
[PFUser requestPasswordResetForEmailInBackground:[alertView textFieldAtIndex:0].text block:^(BOOL succeeded, NSError *error) {
if (succeeded) {
NSLog(@"success");
}else{
NSLog(@"%@",error);
}
}];
这是我在index.js中的代码:
emailAdapter: {
module: 'parse-server-mailgun',
options: {
// The address that your emails come from
fromAddress: 'Natch Support <mailgun@x.co>',
// Your domain from mailgun.com
domain: 'mg.x.co',
// Your API key from mailgun.com
apiKey: 'key-xxxxxxxxxxxxxxxxxxxxxx',
templates: {
passwordResetEmail: {
subject: 'Reset your password',
pathPlainText: resolve(__dirname, '/public/Change_Password.txt'),
pathHtml: resolve(__dirname, '/public/choose_password.html'),
callback: (user) => { return { firstName: user.get('firstName') }}
// Now you can use {{firstName}} in your templates
},
verificationEmail: {
subject: 'Confirm your account',
pathPlainText: resolve(__dirname, '/public/verification_email.txt'),
pathHtml: resolve(__dirname, '/public/verification_email.html'),
callback: (user) => { return { firstName: user.get('firstName') }}
// Now you can use {{firstName}} in your templates
},
customEmailAlert: {
subject: 'Urgent notification!',
pathPlainText: resolve(__dirname, '/public/templates/custom_alert.txt'),
pathHtml: resolve(__dirname, '/public/templates/custom_alert.html'),
}
}
}
}
我可以通过Mailgun API和快速入门指南中列出的其他方法发送电子邮件。但我无法收到从iOS发送的电子邮件。我只对发送密码重置电子邮件感兴趣。如果您有任何建议,我很乐意听到。谢谢!