I am using the same code in Meteor 1.10.2 as I used in Meteor 1.8.0.2, but in 1.10.2 the verification email is only being sent as text instead of the html template. With Meteor 1.8.0.2 it is sent correctly using the template.
I can’t seem to figure out what the difference is between versions 1.8.0.2 and 1.10.2 that is causing this. Here is the code - any suggestions would be greatly appreciated - Thanks, Bob
// server/mail.js
import { Meteor } from 'meteor/meteor'
import { Accounts } from 'meteor/accounts-base'
Meteor.startup(function () {
//-- Subject line of the email
Accounts.emailTemplates.verifyEmail.subject = function (user) {
return 'Confirm Your Email Address'
}
//-- Email
Accounts.emailTemplates.verifyEmail.html = function (user, url) {
const newUrl = url.replace('/#', '/auth')
return `
<body itemscope itemtype="http://schema.org/EmailMessage">
<h2>Thank you for registering with LORROS 3.0</h2>
<p><a href="${newUrl}">Please click here to confirm your email</a></p>
<p>Or cut and paste the following into your browser address box:<br />${newUrl}</p>
</body>
`
}
})
I copied your exact code (except for using the enrollAccount
email template) and I am receiving the correct HTML e-mail
Thanks @jamgold, at least I know that part works. What Meteor packages are you running? Here are mine:
meteor-base@1.4.0 # Packages every Meteor app needs to have
mobile-experience@1.1.0 # Packages for a great mobile UX
mongo@1.10.0 # The database Meteor supports right now
reactive-var@1.0.11 # Reactive variable for tracker
standard-minifier-css@1.6.0 # CSS minifier run for production mode
standard-minifier-js@2.6.0 # JS minifier run for production mode
es5-shim@4.8.0 # ECMAScript 5 compatibility for older browse
ecmascript@0.14.3 # Enable ECMAScript2015+ syntax in app code
typescript@3.7.6 # Enable TypeScript syntax in .ts and .tsx modules
shell-server@0.5.0 # Server-side component of the `meteor shell` command
autopublish@1.0.7 # Publish all data to the clients (for prototyping)
insecure@1.0.7 # Allow all DB writes from clients (for prototyping)
static-html # Define static page content in .html files
react-meteor-data # React higher-order component for reactively tracking Meteor data
accounts-password@1.5.1
email@1.2.3
meteorhacks:ssr
… and here are my npm installed packages:
"dependencies": {
"@babel/runtime": "^7.8.4",
"@material-ui/core": "^4.10.2",
"@material-ui/icons": "^4.9.1",
"@material-ui/lab": "^4.0.0-alpha.56",
"@mdi/js": "^5.3.45",
"@mdi/react": "^1.4.0",
"bcrypt": "^5.0.0",
"better-docs": "^2.0.1",
"i18next": "^19.4.5",
"i18next-browser-languagedetector": "^4.2.0",
"install": "^0.13.0",
"jsdoc": "^3.6.4",
"meteor-node-stubs": "^1.0.0",
"npm": "^6.14.5",
"react": "^16.13.0",
"react-dom": "^16.13.0",
"react-hook-form": "^5.7.2",
"react-hook-form-devtools": "^1.2.0",
"react-i18next": "^11.5.1",
"react-router-dom": "^5.2.0",
"simpl-schema": "^1.5.6",
"validator": "^13.1.1"
},