I am trying to copy the source code of a 3rd party email provider I'm using to match their look and feel.
I am viewing the raw source, to format it I had to remove all the =\ns (the end value of a line because the raw source breaks it up), however I still can't seem to figure out what to do from there to copy the styling since I can't find a parser to correctly handle this email HTML. Any recommendations on formatting an email or just grabbing the styling of it?
PS: I'm using nodemailer for sending emails
It was a bit of a pain, but here are the steps in visual studio code:
Remove all =\n ("=" followed by new line)
rename to an .html file if you haven't instead of .eml
replace all instances of =3D" with ="
search for any more locations for 3D, delete each one you can
Now you have good html which just needs to be formatted, I recommend using a formatter like https://www.freeformatter.com/html-formatter.html
You now have your template, use templated strings to insert variables as needed. Use this for the html value of nodemailer
Related
I've created a very simple package that loops through folders (and subfolders), retrieving a list of files that exist and compiling them into a variable called str_AllFiles. The ForEach loop does its thing, the script task to compile the string does its thing, and when it's all said and done the Send Mail task does its thing. Everything works just fine...except that the resultant email that's generated comes out as hyperlinks to the actual files instead of just directory/file names. The directory/file names are present, but they are all hyperlinks to the files themselves.
Is there any way to reformat the string variable or the Send Mail message source so that it's plain text? I've seen some suggestions to use a script task to send the email as HTML, but when using that (from here: http://microsoft-ssis.blogspot.com/2013/08/sending-mail-within-ssis-part-2-script.html), but I keep getting an exception error that I can't track down when coding this. To be fair, I'm hard-coding the FROM, TO, and SUBJECT when using the HTML version, which may very well be the issue here.
Any ideas on this? How do I transform the message source so that it's plain text and not a page of hyperlinks?
I have a requirement where I need to produce data in table format and send the html file to team.
For example:
Column 1
list of jobs running
I have created the above with the help of HTML table.
I need to add another column "Remarks" where user can update their remarks and save the html file and share it with the team.
Is it possible with HTML, if yes may I know how to achieve this ?
I am new to HTML, please excuse me if my question is silly.
No.
HTML is a data format. You need a programming language.
Typically this would be handled by using an HTML form, which POSTs data to an HTTP server where server-side code (written in the programming language of your choice) would store it in a database.
The HTML document with the table would be rendered on demand using data from the database.
Normally, you would share a URL to the HTTP server rather than the HTML document itself (although you could download it and then share it).
Yes , it is possible to make changes to your own html but you need a scripting language to do so.
I would recommend you to use Javascript which allows you to change html tags values based on the user input.
using the document.getElementById().innerHTML you can easily change the value of html tags..
Here is a link which will expalin this topic much more elaborately.
https://www.w3schools.com/jsref/prop_html_innerhtml.asp
I'm still a bit newbie in the code game, and i would like some advices from senpai.
Context :
I'm making a angular 5 app which has a form, which is using also QuillJS, a rich text editor for only one question (the previous questions are simple input field for strings or numbers). My goal is to allow my users to download the form and the text from QuillJS they completed, on a .docx file (Word). And of course i'm doing this because i want to keep the formatted text from QuillJs, otherwise i would have just get a good ol' string.
Issue :
The point is, i'm already building a docx file for the first questions of the form and the only method i found for now to put my html string from QuillJs in a Word readable data type, is to use html-docx-js library.
This post even explain how. But, BUT, i don't want to use saveAs function (see the post), that create a file and put the content in it. I want to put the content in the docx file i'm already creating.
So here is my question, how would you, senpai, do it ?
The thing is that i've got a Blob file (cf post), but i don't know how to put it in my docx file. I tried to see if FileReader function could do the job, but well... i don't get how to integrate this special Blob file type (which is : application/vnd.openxmlformats-officedocument.wordprocessingml.document) in the docx file.
Maybe there is another way, i'm open to any suggestions, i don't mind at all to change my way of doing.
Thank you. Save internet, give me a tip.
The official documentation for html-docx-js does not state any other options than the asBlob method. I suggest two options:
Decoding the DOCX:
The Blob filetype is not special. The blob is just binary representation of the docx. I found in SE question that the docs in fact zipped XML document. You could unzip it using JSZip or other JS solution, then read it using FileReader and try to deal with it in a DOM manner. I'm not qualified to go into details how that could work.
Adding HTML to the user input first and then outputting it as a whole
This is changing the way you want to do it. In this way, I would first create formatted HTML with the data you collected in other parts of the questionnaire. Then you append the rich data from the rich editor. At last you take this HTML data and save it into single file using the asBlob function.
The second solution will maybe strip some customization from your original approach, but it seems much faster to implement.
I want to know if it is possible to create a Drop-down list in HTML using Only a txt file?
I have a list of places/countries, instead of creating for each, can i import it somehow from a txt file while each country is set in a single line?
(i know how it's done using php, i just wonder if it could be done without it)
Using pure html? No.
You will either need to use a preprocessor (sed,perl,etc) to generate the html page or a dynamic language to do it at run time - html is a static language.
You should be able to do it with javascript, but the only way I can think of involves making the txt file available on the web and using a XMLHttpRequest() to get it. There is the new file api in html5, but that is aimed at local (to the client) files.
I have created a rrdcgi script to display information about the system performance with graphs. Now I would like to add an option for the users to create PDF on the fly with the details on current page (images and information) and header and footer. I also want the generated PDF files to be saved in some location so that that can be easily accessed next time. Is this possible to do with rrdcgi or any Perl code would be really appreciated.
I need this options
You need to consider what you want to put in the PDF: Do you want an exact replica of the web page the user is viewing (too hard to be close to impossible without having the user's browser installed on your side and using its print output) or do you want the same information in a roughly similar layout?
An important issue is how you are generating the HTML: I did something similar once to generate PDF receipts for experiment participants (now, I just output HTML with print styles).
The HTML is generated using HTML::Template although Template.pm would be just as fine.
It is then trivial to write another template, one that generates a LATEX document which can be processed using pdflatex. If you save the data the time the snapshot is requested, you can add the snapshot to a queue that generates documents asynchronously so that requests do not tie up the web server.
Update: Looking at rrdcgi, I now realize that it already does use a template. That is perfect: Instead of putting HTML in the template, put LATEX code in the template and run rrdcgi with the --filter option to create a LATEX source file which you can run through pdflatex. I guess the problem to solve there is to be able to use the exact same data that was used to generate the page the user is looking at.
If it is not possible to re-run rrdcgi with the exact same data, consider adding some JavaScript that submits the HTML source of the page the user is reviewing (or some JSON representation thereof) to a CGI script that parses the HTML and outputs LATEX. Writing clean HTML in the original template and judicious use of class and id attributes would help there.
I do not have time to test any of these ideas right now, but I will take a look again within the next couple of days.
Is it worth the effort?
Why don't you add a FAQ explaining how to setup a PDF-printer on Windows/MAC/Linux and provide a 'clean' page that can then be printed?
Since you apparently have to create the PDF,
take a look at this (what-is-the-best-perl-module-to-use-for-creating-a-pdf-from-scratch) post here on SO.
There is also this post, that could combine the 'clean' HTML page and a server-side print.
Regarding the LaTeX route, if you have rrdcgi generate graphs in pdf format, pdflatex will be able to integrate them directly into the document, producing super quality pdf with graphs ... very slick. Sorry, no code.