Hello,
I’m trying to make email with HTML. Now it sending just a plain text.
HTML page is ready and all I should do is integrate it in existing code.
And here I’m not sure how to do it.
Now I have a code like this:
let subject = 'Confirmation ' + Name + ' date: ' + moment(start).format("DD MM YYYY, HH:mm:ss");
let text = 'Your rdv of' + moment(start).format("DD MM YYYY, HH:mm:ss") + ' is confirmed' + ' \n\n' + 'Hello,' + '\n\n' + 'You ' + Name + ' is confirmed.' + '\n\n';
Meteor.call('sendEmail', email_Client, 'MyMail <somemail@mail.com>', subject, text);
So all I want to do is add a bit styles to my email. Can I replace last argument text by the string with html code?
Could you help me to find the easiest way to integrate html page in my email sending.
Just a question, as I understood Email.send() is a server side function. And In my case client-side function is used. Is it possible to send html code with it?
Also I tried to replace Meteor.call(‘sendEmail’ … ) by Email.send() but it doesn’t work.
Ok, there is email_config.js file and I’m pretty sure it’s what I need. In this file I find function Meteor.methods :
Meteor.methods({
sendEmail: function(to, from, subject, text) {
check([to, from, subject, text], [String]);
// Let other method calls from the same client start running,
// without waiting for the email sending to complete.
this.unblock();
Email.send({
to: to,
from: from,
subject: subject,
text: text
});
},
So as I get it, I should add here all the information about email ( email address, html, subject, etc)? Am I doing right?
Hello,
Sorry to bother you again, but I have a question concerning my html email and don’t want to create a new topic.
I want to make a table of data. It should look like this:
Id | Name | Date | Address |
1 Joe 31/07/2017 London
2 Karl 01/08/2017 Berlin
etc
There is an array of objects with all this information, but I have no idea how to integrate it on my existing html string. I thought about construction like this but it doesn’t work:
When sending an HTML email, should you also set the text field as like a backup or something in case HTML isn’t supported? The doc says it’s “and/or” sort of alluding to this. Was just curious if anyone had tried it.