单击事件仅作用于链接内容,我想更改它,如何更改,更改和单击电子邮件中任何正文部分的单击事件?
const path = require("path");
const fs = require("fs");
const mailgun = require("mailgun-js");
const DOMAIN = "my-domain";
const mg = mailgun({apiKey: "mydomain",domain: DOMAIN});
var filepath = path.join(__dirname,'Invoice-data.pdf');
mg.get(`/${DOMAIN}/events`,function (error,body) {
console.log(body);
});
const data = {
from: "Mailgun Sandbox <postmaster@sample.mailgun.org>",to: "sampletest@gmail.com",subject: "Hello",text: "Testing some Mailgun awesomness!","o:tracking": 'True',html: 'Hello,This is not a plain-text email<a href="https://www.mailgun.com/blog/how-to-send-transactional-email-in-a-nodejs-app-using-the-mailgun-api/' + '">Click here to add your email address to a mailing list</a>',attachment: filepath,};
mg.messages().send(data,body) {
console.log(body);
});