We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi there
I'm trying to get my mailgun template to send, but when I pass in the template name as the option, I get the following error:
Error: Need at least one of 'text' or 'html' parameters specified
When I do supply an argument, it overrides the use of the template.
Stack: "express": "^4.17.1", "mailgun-js": "^0.22.0", "nodemailer": "^6.7.2", "nodemailer-mailgun-transport": "^1.4.0",
Here is my code:
const nodeMailer = require("nodemailer"); const mailGun = require("nodemailer-mailgun-transport"); const express = require("express"); const router = new express.Router(); const auth = { auth: { api_key: process.env.MAILGUN_API_KEY, domain: process.env.MAILER_DOMAIN, }, }; let mailgunAuth = mailGun(auth); let transporter = nodeMailer.createTransport(mailgunAuth); router.post("/collaboration", async (req, res, next) => { const { senderUN, recipientUN, toEmail } = req.body; const options = { from: process.env.MAILER_FROM, to: toEmail, subject: `New collaboration request from ${senderUN}!`, template: "collaboration_request", html: "<h1>Hello World</h1>", "h:X-Mailgun-Variables": JSON.stringify({ sender: senderUN }), };
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi there
I'm trying to get my mailgun template to send, but when I pass in the template name as the option, I get the following error:
Error: Need at least one of 'text' or 'html' parameters specified
When I do supply an argument, it overrides the use of the template.
Stack:
"express": "^4.17.1",
"mailgun-js": "^0.22.0",
"nodemailer": "^6.7.2",
"nodemailer-mailgun-transport": "^1.4.0",
Here is my code:
The text was updated successfully, but these errors were encountered: