Tag: mailgun

电子邮件validation后无法创build用户

我使用passport.js和mailgun-validate-email来尝试validation电子邮件,然后根据该电子邮件创build一个用户帐户。 我可以得到它来validation电子邮件,但它不会完成POST请求实际创build用户。 它最终会显示一个日志,但是它甚至不会给出我觉得奇怪的状态代码。 我正在用摩根来看这个。 Passport.use注册中间件 passport.use('signup', new LocalStrategy({ usernameField: 'email', passReqToCallback : true }, function(req, email, password, done) { var findOrCreateUser = function(){ console.log(req.body.email); User.findOne({ email: req.body.email }, function(err, existingUser) { if(err){ console.log(err); } if (existingUser) { req.flash('form', { email: req.body.email }); return done(null, false, req.flash('error', 'An account with that email address already exists.')); } […]

validation邮件后,护照无法使用

我使用passport.js和mailgun-validate-email来尝试validation电子邮件,然后根据该电子邮件创build一个用户帐户。 我可以得到它来validation电子邮件,但它不会完成POST请求实际创build用户。 它最终会显示一个日志,但是它甚至不会给出我觉得奇怪的状态代码。 我正在用摩根来看这个。 通常情况下,这只是-状态码将在哪里。 Passport.use注册中间件 passport.use('signup', new LocalStrategy({ usernameField: 'email', passReqToCallback : true }, function(req, email, password, done) { var findOrCreateUser = function(){ console.log(req.body.email); User.findOne({ email: req.body.email }, function(err, existingUser) { if(err){ console.log(err); } if (existingUser) { req.flash('form', { email: req.body.email }); return done(null, false, req.flash('error', 'An account with that email address already exists.')); […]

正确的方式来stream`request`请求?

我想从request创build一个ReadableStream对象,最终我想将它传递给mailgun-js的数据对象的附件variables: var fileStream = null; request(String(url)).pipe(fileStream); msg.attachment = new mailgun.Attachment({ data: fileStream, filename: 'my_custom_name.png', knownLength: fileStat.size, contentType: 'image/png'}); 什么是正确的方法来做到这一点?

types错误:done不是一个函数(nodemailer)

我正在使用nodemailer忘记密码的应用程序,电子邮件执行忘记密码,但是当用户重置密码他们没有得到一个确认电子邮件。 不知道为什么没有发生。 似乎是在完成(错误)线上抛出一个错误。 下面是重置令牌的获取处理程序 //get handler for reset token app.post('/reset/:token', function(req, res, next) { async.waterfall([ function(done) { User.findOne({ resetPasswordToken: req.params.token, resetPasswordExpires: { $gt: Date.now() } }, function(err, user) { if (!user) { req.flash('error', 'Password reset token is invalid or has expired.'); return res.redirect('back'); } user.password = req.body.password; user.resetPasswordToken = undefined; user.resetPasswordExpires = undefined; user.save(function(err) { […]

mailgun传入邮件事件获取附件的URL

我有一个节点端点,接收json中的传入电子邮件,并附带任何来自mailgun的附件。 附件是在json数组(xxx.com用于隐私) attachments: '[{"url": "https://sw.api.mailgun.net/v3/domains/xxx.com/messages/eyJwIjpmYWxzZSwiayI6ImZhMTU0NDkwLWVmYzgtNDVlNi1hYWMyLTM4M2EwNDY1MjJlNCIsInMiOiI2NmU1NmMzNTIwIiwiYyI6InRhbmtiIn0=/attachments/0", "content-type": "image/png", "name": "ashfordchroming_logo.png", "size": 15667}] 但是,如果我在浏览器中inputurl: https://sw.api.mailgun.net/v3/domains/xxx.com/messages/eyJwIjpmYWxzZSwiayI6ImZhMTU0NDkwLWVmYzgtNDVlNi1hYWMyLTM4M2EwNDY1MjJlNCIsInMiOiI2NmU1NmMzNTIwIiwiYyI6InRhbmtiIn0=/attachments/0 我明白了 { "message": "Domain not found: xxx.com" } 我想用最简单的方法来显示HTML中的图像附件,我希望这个URL能够工作,因为mailgun存储附件。 所以我只是想从Node中的模板呈现url。 我是否需要将auth / API密钥凭证附加到URL的前端才能执行此操作来testing和开展工作?

在Parse服务器CloudCode中使用已经初始化的mailadapter

使用parse-server 2.2.6,如何在云代码中使用SimpleMailgunAdapter? 我像这样初始化我的parseserver: var api = new ParseServer({ databaseURI: databaseUri, cloud: process.env.CLOUD_CODE_MAIN, appId: process.env.APP_ID || 'myAppId', masterKey: process.env.MASTER_KEY || '', //Add your master key here. Keep it secret! serverURL: process.env.SERVER_URL, // Don't forget to change to https if needed appName: 'AppName', publicServerURL: process.env.SERVER_URL, verifyUserEmails: true, emailAdapter: { module: 'parse-server-simple-mailgun-adapter', options: { fromAddress: 'mymail@mail.com', apiKey: process.env.MAILGUN_API_KEY, […]

用Mocha和SinontestingMailgun .send()方法

我正在尝试编写一个快速中间件函数的unit testing,通过ping Mailgun API来发送电子邮件。 module.exports = { sendEmail: function (req, res) { let reqBody = req.body; let to = reqBody.to; let from = reqBody.from; let subject = reqBody.subject; let emailBody = reqBody.body; let data = { from: from, to: to, subject: subject, text: emailBody }; mailgun.messages().send(data, function (error, body) { if (error) { res.status(400).json(error); return; […]

我如何发送与前端JavaScript的自动电子邮件?

有没有什么办法从纯前端JavaScript而不是node.js发送自动电子邮件? Mailgun,Maildrill和Sendgrid都只使用node.js或php? 没有服务器端代码可以做到这一点吗? 我需要这样做的原因是,我不知道如何将node.js添加到现有的网站项目中,而且node.js也非常混乱。 有什么build议么?

用mailgun通过node.js发送邮件 – 找不到请求的URL

我的堆栈:使用Express 4.x mailgun模块的node.js: mailgun-js 我目前正在开发本地机器,并尝试发送一些简单的确认电子邮件,如本模块示例所示: var api_key = 'key-xxx'; var domain = 'http://mg.xxx.com/'; var mailgun = require('mailgun-js')({apiKey: api_key, domain: domain}); var data = { from: 'Billing <no-reply@mydomain.com>', to: data.email, subject: 'Thanks for buying ' + data.product, text: 'You can create your plan right now or visist http://www.someurl.com later.' }; mailgun.messages().send(data, function (err, body) { if(err){ […]

尝试用邮件发送邮件,错误

试过下面的mailgun的nodejs教程 ,但是我得到这个错误: error { [Error: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <title>404 Not Found</title> <h1>Not Found</h1> <p>The requested URL was not found on the server.</p><p>If you entered the URL manually please check your spelling and try again.</p> ] statusCode: 404 } undefined 我在节点服务器中使用的代码如下所示: var express = require("express"); var expressApp = express(); var server = […]